logger::utils - Utilities for logger
This package adds template based appenders.
This command translates formatString into an expandable command string. The following strings are the known substitutions (from log4perl) allowed to occur in the formatString:
Category of the logging event
Fully qualified name of logging event
Current date in yyyy/MM/dd hh:mm:ss
Hostname
Message to be logged
Method where logging event was issued
Priority of logging event
Pid of current process
This command ...
This command will create an appender for the specified logger services. If no service is specified then the appender will be added as the default appender for the specified levels. If no levels are specified, then all levels are assumed.
Example of usage:
% set log [logger::init testLog] ::logger::tree::testLog % logger::utils::applyAppender -appender console -serviceCmd $log % ${log}::error "this is an error" [2005/08/22 10:14:13] [testLog] [global] [error] this is an error
This command is designed to be added via trace leave to calls of logger::init. It will look at preconfigured state (via ::logger::utils::applyAppender) to autocreate appenders for newly created logger instances. It will return its argument log.
Example of usage:
logger::utils::applyAppender -appender console set log [logger::init applyAppender-3] ${log}::error "this is an error"
This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report such in the category logger of the Tcllib Trackers. Please also report any ideas for enhancements you may have for either package and/or documentation.
Programming tools
Copyright © 2005 Aamer Akhter <aakhter@cisco.com>