man MDN::Log () - Perl extension for libmdn log module.
NAME
MDN::Log - Perl extension for libmdn log module.
SYNOPSIS
use MDN::Log; MDN::Log->setproc_none(); MDN::Log->setproc_stderr(); MDN::Log->setlevel('warning'); $level = MDN::Log->getlevel();
DESCRIPTION
CWMDN::Log provides a Perl interface to the log module of the MDN library (a C library for handling multilingual domain names) in the mDNkit.
With this module you can control how log messages are handled.
CLASS METHODS
Although this module does not provide object interface, all the functions should be called as class methods, in order to be consistent with other modules in CWMDN::.
MDN::Log->setlevel('warning'); # OK MDN::Log::setlevel('warning'); # NG
- setlevel($level)
- Sets log level to CW$level. Valid values for CW$level are CW'fatal', CW'error', CW'warning', CW'info', CW'trace', and CW'debug'. The default level is determined by the value of the enrironment variable CWMDN_LOG_LEVEL.
- getlevel()
- Returns the current log level.
- setproc_stderr()
- Resets the log handler to the default one, which outputs the log messages to standard error.
- setproc_none()
- Sets the log handler to the one which does nothing.
- setproc([&handler])
-
Sets log handler to CW&handler.
CW&handler receives log level and message string as arguments
in that order.
sub my_handler { my ($level, $message) = @_; # (process log message...) }
If CW&handler is ommited, log handler is reset to the default one. This is the same as CWsetproc_stderr().
SEE ALSO
MDN library specification