Esmith::Logger

From SME Server
Jump to navigation Jump to search

esmith::Logger(3) User Contributed Perl Documentation esmith::Logger(3)

NAME

      esmith::Logger - A filehandle abstraction around Syslog.

SYNOPSIS

          use esmith::Logger;

          tie *FH, 'esmith::Logger';
          print FH "log message";
          close FH;

you can do a function

 use esmith::Logger;
 #we create a function because we want to write in log
  sub log2messages
  {
      my $message = shift;
      tie *FH, 'esmith::Logger';
      print FH "$message";
      close FH;
  }

and now in your code if you want to use it

log2messages("Your error message");