MIME::Tools::PrefixingLogger - wrap a logger in an prefixing mechanism
### Create the logger: $backend_logger = ...; $logger = MIME::Tools::PrefixingLogger->new($backend_logger);
### Change prefix (comments show sample of subsequent logged messages): $logger->push_prefix("1"); ### 1: message... $logger->push_prefix("A"); ### 1: A: message... $logger->pop_prefix; ### 1: message... $logger->push_prefix("B"); ### 1: B: message...
### Log messages of various types (indents, then relays to backend): $logger->debug("about to open config file"); $logger->warning("missing config file: must create"); $logger->error("unable to create config file");
This is useful in Parsing complex MIME entities: the logged messages can be indented based on how deeply they are nested in the entity.
Закладки на сайте Проследить за страницей |
Created 1996-2024 by Maxim Chirkov Добавить, Поддержать, Вебмастеру |