Full-Duplex Communications

Engineered Telecommunications Solutions

Download Logging::Log - Version 1.003

NAME

Logging::Log - Simple Object-oriented logging interface

SYNOPSIS

    # Object initialization:
    use Logging::Log;
    my $log = Logging::Log->new();

    # Pointing to an opened filehandle:
    my $log = Logging::Log->new(Handle => \*F);

    # Pointing to a /path/file using the 'overwrite' mode:
    my $log = Logging::Log->new(File => "/tmp/$thisfile.log", Mode => 'overwrite');

    # Changing and/or adding to predefined logging levels:
    $log->setLevel(5 => 'MOD_CRIT', 8 => 'MOD_OOPS');

    # Logging message to the set default level:
    $log->entry("Here is a standard message. Simple, eh?");

    # Logging message to a level index other than the default:
    $log->entry("Here is a Warning message.", 3);

    # Changing the default logging level:
    $log->setDefault(8);

    # Print a list of the predefined logging levels:
    print $log->showLevel;

    # Close a log that has been opened via a FH or a FQFN:
    $log->close;

DESCRIPTION

Logging::Log provides the user with a clean, useable-out-of-the-box, object based logging interface that shines with simplicity.

There are other good perl based logging facilities available, each with their own merits. I chose to build Logging::Log because several clients of ours had requested a very simple logging interface that could just be "plugged in" and have message strings sent to a log in a syslog based format. Logging::Log is ready to use right out-of-the-box and has just enough custom features to make it usable by everyone.

Methods

Examples

PLATFORMS

Any OS with an installation of perl, v5.6.1 or better

INSTALLATION

Download the source Logging::Log and place in any valid root library path. If the directory ./Logging does not exist, create and place Log.pm w/in that directory

TODO

Perhaps add flexibility in time/date stamping & maybe file IO locking, but then this module wouldn't be simple any longer.

BUGS

None known

SEE ALSO

perl(1), CPAN - http://search.cpan.org/search?query=log

SUGGESTIONS/CONTRIBUTIONS

Got a question? Suggestions? Maybe you would like to contribute to our new and growing public archive. Talk to us at perl.dev@full-duplex.com

AUTHOR

D. Huggins, (dhuggins AT full-duplex DOT com), http://www.full-duplex.com

COPYRIGHT AND LICENSE

Copyright (C) 2003 - 2008 by Full-Duplex Communications, Inc. All rights reserved.

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

If you need a copy of the GNU General Public License write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

.