2 #################################################################################
4 # File: $RCSfile: MAPSLog.pm,v $
5 # Revision: $Revision: 1.1 $
6 # Description: MAPS routines for logging.
7 # Author: Andrew@DeFaria.com
8 # Created: Fri Nov 29 14:17:21 2002
9 # Modified: $Date: 2013/06/12 14:05:47 $
12 # (c) Copyright 2000-2006, Andrew@DeFaria.com, all rights reserved.
14 ################################################################################
21 use lib $FindBin::Bin;
25 use vars qw (@ISA @EXPORT);
51 my ($condition, $type) = @_;
53 return MAPSDB::countlog $condition, $type;
59 return MAPSDB::FindEmail $sender;
63 my ($nbr_days, $date) = @_;
66 $date ||= Today2SQLDatetime
70 while ($nbr_days > 0) {
71 my $ymd = substr $date, 0, 10;
72 my $sod = $ymd . ' 00:00:00';
73 my $eod = $ymd . ' 23:59:59';
78 my $condition = "log.type=\'$_\' and (log.timestamp > \'$sod\' and log.timestamp < \'$eod\')";
79 $stats{$_} = countlog $condition, $_;
82 $dates{$ymd} = \%stats;
84 $date = SubtractDays $date, 1;
92 my ($type, $sender, $msg) = @_;
94 AddLog $type, $sender, $msg;
100 Logmsg 'debug', '', $msg;
106 Logmsg 'error', '', $msg;
112 Logmsg 'info', '', $msg;