NAME

slackget10::Log - Perl extension for slack-get's log system

SYNOPSIS

  use slackget10::Log;
  my $lo = slackget10::Log->new(
        LOG_FILE = '/var/log/slack-get.log'
        NAME = 'slack-get',
        LOG_LEVEL = 2
  );
  $lo->Log(1,"This is a log message\n");

DESCRIPTION

This module is use by slack-get for the log system

EXPORT

None, it's an Object Oriented module.

This module is really easy to use, it provide an OO interface to contain and process logs data.

CONSTRUCTOR

        my $lo = slackget10::Log->new(
                LOG_FORMAT => $CONF{'log-format'},
                NAME => $NAME,
                VERSION => $VERSION,
                LOG_FILE => $CONF{'log-file'},
                LOG_LEVEL => $CONF{'log-level'}
        );

new

The constructor take severals options :

     * LOG_FORMAT the log format (read the configuration manpage for more details).


     * NAME the name of the module or binary wich is attach to this slackget10::Log object


     * VERSION version of the module or binary wich is attach to this slackget10::Log object


     * LOG_FILE the file where were loged messages


     * LOG_LEVEL the log level


     * LOG_ROTATE undef disable the log rotation, other value enabled it.


     * CRITICAL_SIZE the maximum size of the log file (if the file is bigger than CRITICAL_SIZE the rotation process is launch).

Moreover, this constructor accept every argument of slackget10::Log::logRotate.

METHODS

Log

Log(LOG_LEVEL, MESSAGE) : write MESSAGE in LOG_FILE if LOG_LEVEL is ge with the constructor's LOG_LEVEL. You can typically read this like : "log MESSAGE if the log level request by the constructor is ge than LOG_LEVEL"

Rotate

Rotate([a slackget10::Log::logRotate object]) : this method try to catch a valid slackget10::Log::logRotate or create a new one and launch the logRotate routine of this object. You can optionnaly pass the slackget10::Log::logRotate object as an argument.

preview

preview(MESSAGE) : return a log characters string without write it in LOG_FILE. This method is use by slack-GUI to give a preview of the log format.

SEE ALSO

man pages : slack-get(8), slack-get.conf(5), slack-plugins.conf(5)

perldoc : slackget10::Log::logRotate

http://slackget.infinityperl.org/

AUTHOR

Arnaud DUPUIS, <a.dupuis@infinityperl.org>

COPYRIGHT AND LICENSE

Copyright (C) 2004 by Arnaud DUPUIS

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.3 or, at your option, any later version of Perl 5 you may have available.