NAME
Hub::Base::Logger - use Hub; my $log = Hub::mkinst( 'Logger', "/var/log/service.log" ); $log->show( "warn, info, foo" );
$log->msg( "I will print b/c level 'info' is specified", 'info' );
$log->msg( "I will print b/c there is no type" );
$log->err( "$!: $filename" );
$log->msg( "I will not print", "kmfdm" );
$log->flush(); # write to file (also called on DESTROY)
Part of the Hub Library
SYNOPSIS
Record log messages, write them to file and append to stdout.
DESCRIPTION
This logger is used by this library. Logging levels are not standardized, but you can specify show( 'all' ) to see what gets used.
Always available:
Unspecified messages
err Error, fatal errors such as configuration issues. (always
print, unless 'opressed' is set)
THese are used by this library, and may also server as examples:
info Informational, users will set this as the default to get a warm
fuzzy of program flow.
warn Warning, non-fatal errors such as configuration issues.
verb Verbose, programmers will look at this output to determine where to
start debugging an error.
dbg Debug, these messages are useless unless you know what you're
looking for.
METHODS
disable | logRaw | msg | set |
dump | measurefrom | new | show |
err | measureto | out | tee |
flush | morte | refresh | trim_file |
- disable
-
No logging
- dump
-
Usage: dump [MESSAGE], ?REF, [LEVEL]
Where:
MESSAGE An optional message to prefix the output ?REF A reference to the value which will be dumped LEVEL The level passed as a flag, -verb for example.
Dump hash|array values. ?REF? may not be a HASH or ARRAY reference, since this method is used to inspect variables. In that case, it will treated like a scalar.
- err
-
- flush
-
Usage: flush Usage: flush -tstamp => TIMESTAMP flush -tee => none|html|stdout|stderr
Write log messages to disk.
Optionally tee these messages (to stdout or stderr or stdout wrapped with HTML comments).
TIMESTAMP as from Time::HiRes::gettimeofday.
- logRaw
-
- measurefrom
-
- measureto
-
- morte
-
Usage: morte
Log the message as an error, flush the log file, and die with the message.
- msg
-
Log a message at a specific level
- new
-
- out
-
write directly to standard out
- refresh
-
- set
-
Toggle output options
- show
-
'all' will display all messages. Otherwise, specify the message level (see 'msg' below.)
- tee
-
Append messages to stdout (0=no, 1=html, 2=raw)
- trim_file
-
keep the logfile below a certian size
INTERNAL
DESTROY |
- DESTROY
-
AUTHOR
Ryan Gies
COPYRIGHT
Copyright (c) 2006 Livesite Networks, LLC. All rights reserved.
Copyright (c) 2000-2005 Ryan Gies. All rights reserved.
UPDATED
This file created by mkdocs.pl on 8/29/2006 at 2:07pm