Changeset 28

Show
Ignore:
Timestamp:
02/27/03 16:09:17 (12 years ago)
Author:
jesus
Message:

comment out DBI, leave in for example

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/mylogger.pm

    r23 r28  
    33package mylogger; 
    44 
    5 use DBI; 
     5#use DBI; 
    66use POSIX; 
    77use vars qw/$dbh $sth/; 
     
    1111    my $group = shift; 
    1212    my $message = shift; 
     13    chomp($message); 
    1314 
    14     $dbh ||= DBI->connect("DBI:mysql:database=weblogs", "logger", "", { RaiseError => 0 }); 
    15     warn "DBI->connect failed." unless($dbh); 
    16     if($dbh) { 
    17         $sth ||= $dbh->prepare(q{INSERT INTO logs (host, domain, timestamp, data) VALUES(?,?,?,?)}); 
    18     } 
     15#    $dbh ||= DBI->connect("DBI:mysql:database=weblogs", "logger", "", { RaiseError => 0 }); 
     16#    warn "DBI->connect failed." unless($dbh); 
     17#    if($dbh) { 
     18#        $sth ||= $dbh->prepare(q{INSERT INTO logs (host, domain, timestamp, data) VALUES(?,?,?,?)}); 
     19#    } 
    1920 
    2021    my ($user, $host) = ($sender =~ /#([^#]+)#([^#]+)/); 
    2122    my ($time) = ($message =~ /\[([^\]]+)\]/); 
    2223    $time ||= stftime("%d/%b/%Y:%H:%M:%S %z", localtime(time)); 
    23     $sth && $sth->execute($host, $group, $time, $message); 
     24#    $sth && $sth->execute($host, $group, $time, $message); 
    2425    print STDERR "Insert($host, $group, $time, $message);\n"; 
    2526}