Taxi::Mysql::Logger - extendable full-text index using mysql: logger class


(Back to Top)


NAME

Taxi::Mysql::Logger - extendable full-text index using mysql: logger class

(Back to Top)


SYNOPSIS

 ##========================================================================
 ## PRELIMINARIES
 use Taxi::Mysql::Logger;
 ##========================================================================
 ## Constructors etc.
 $thingy = $CLASS_OR_OBJ->new(%args);
 $obj2 = $obj->clone();
 ##========================================================================
 ## API: Properties
 \%vlevels = $class_or_obj->vlevels();
 $verbose = $class_or_obj->verbose();
 $logFile = $class_or_obj->logFile();
 $logName = $class_or_obj->logName();
 $logClass = $class_or_obj->logClass();
 $bool = $class->logTime();
 $bool = $class->logPid();
 $str = $class_or_obj->logPrefix();
 ##========================================================================
 ## API: level checking
 $bool = $class_or_obj->contains($verboseLevel, $msgLevel);
 ##========================================================================
 ## API: Messages
 undef = $class_or_obj->_print(@msg);
 undef = $class_or_obj->vlmsg($msgLevel, $logLevel, @msg);
 undef = $class_or_obj->vmsg($msgLevel, @msg);
 undef = $class_or_obj->vmsg1($msgLevel, @msg);

(Back to Top)


DESCRIPTION

Globals

Variable: %VLEVELS

Symbolic verbosity level resolution hash. Keys are symbolic verbosity level names, values are regular expressions of elementary verbosity level names matching the key. Currently defined as:

  (
   'silent'   => '(?:^$)',
   'none'     => '(?:^$)',
   'errors'   => '(?:error)',
   'error'    => '(?:error)',
   'warnings' => '(?:error|warn)',
   'warn'     => '(?:error|warn)',
   'info'     => '(?:error|warn|info)',
   'progress' => '(?:error|warn|info|progress)',
   'debug'    => '(?:error|warn|info|progress|debug)',
   'trace'    => '(?:trace)',
   'default'  => 'progress',
  )
Variable: %EXPORT_TAGS

Taxi::Mysql::Logger exports the %VLEVELS hash under the tag ':verbose'.

Defaults for new (subclass) objects:
$logPid
$logTime
$verbose
$logName
$logClass
$logFile

Constructors etc.

new
 $thingy = $CLASS_OR_OBJ->new(%args);

Object structure / keyword %args:

   {
    ##-- verbosity behavior
    verbose => $vlevel,               ##-- default: 'default'
    vlevels => \%vlevels,             ##-- default: \%vlevels,
    ##-- log file
    logFile => $filespec,             ##-- default: '>>&STDERR',
    logName => $logName,              ##-- default log name (default: ref($that)||$that)
    logClass => $logClass,            ##-- log name class (default: none)
   }
clone
 $obj2 = $obj->clone();

Deep copy using Storable::dclone().

API: Properties

vlevels
 \%vlevels = $class_or_obj->vlevels();

Get verbosity level resolution hash.

verbose
 $verbose = $class_or_obj->verbose();

Get verbosity level.

logFile
 $logFile = $class_or_obj->logFile();

Get selected log file.

logName
 $logName = $class_or_obj->logName();

Get selected name for logging.

logClass
 $logClass = $class_or_obj->logClass();

Get selected 'class' (not really a perl class, just another symbolic name) for logging.

logTime
 $bool = $class->logTime();

Get time-logging flag.

logPid
 $bool = $class->logPid();

Get PID-logging flag.

logPrefix
 $str = $class_or_obj->logPrefix();

Get logging prefix string.

API: level checking

contains
 $bool = $class_or_obj->contains($verboseLevel, $msgLevel);

Returns true iff $verboseLevel contains $msgLevel.

API: Messages

_print
 undef = $class_or_obj->_print(@msg);

Basically just a print(). No level-checking is performed.

vlmsg
 undef = $class_or_obj->vlmsg($msgLevel, $logLevel, @msg);

Level-sensitive _print() using $logLevel (instead of $class_or_obj->verbose()).

vlmsg1

Single-line level-sensitive _print(). Prefixes logged message with logPrefix() and calls vlmsg().

vmsg
 undef = $class_or_obj->vmsg($msgLevel, @msg);

Object-based level-sensitive _print(), for use by subclasses.

vmsg1
 undef = $class_or_obj->vmsg1($msgLevel, @msg);

Object-based single-line level-sensitive _print(), for use by subclasses.

(Back to Top)


ACKNOWLEDGEMENTS

Perl by Larry Wall.

(Back to Top)


AUTHOR

Bryan Jurish <moocow@ling.uni-potsdam.de>

(Back to Top)


COPYRIGHT AND LICENSE

Copyright (C) 2006 by Bryan Jurish

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

(Back to Top)


SEE ALSO

perl(1), Taxi::Mysql(3perl), Taxi::Mysql::Base(3perl).

(Back to Top)

 Taxi::Mysql::Logger - extendable full-text index using mysql: logger class