MIME::Tools::ToolkitLogger - a logger which uses Perl's warn()
use MIME::Tools::ToolkitLogger;
### Creation:
$logger = new MIME::Tools::ToolkitLogger;
### Log messages of various types:
$logger->debug("about to open config file");
$logger->warning("missing config file: must create");
$logger->error("unable to create config file");
Debug message are only logged if you have turned ``debugging'' on in the MIME::Tools configuration.
Warning messages are only logged if $^W is set true and MIME::Tools is not configured to be ``quiet''.
Error messages are only logged if $^W is set true and MIME::Tools is not configured to be ``quiet''.
The PREFIX, if given, precedes all messages; it makes it easier to filter based on the toolkit. If given, the string should end in colon and space. The default is ``MIME-tools: ''.
This really could be broken out into two classes: one which just logs to warn(), and a wrapper which consults MIME::Tools configuration before doing anything.
See MIME::Tools for more information on configuring the toolkit options which affect this module, particularly debugging() and quiet().
See perlvar for details on $^W.
|
Закладки на сайте Проследить за страницей |
Created 1996-2025 by Maxim Chirkov Добавить, Поддержать, Вебмастеру |