Eryq > MIME-tools-6.200_02 > MIME::Tools::IndentingLogger

Download:
MIME-tools-6.200_02.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  12
Open  8
View Bugs
Report a bug
Source  

NAME ^

MIME::Tools::IndentingLogger - wrap a logger in an indenting mechanism

SYNOPSIS ^

    ### Create the logger:
    $backend_logger = ...;   
    $logger = MIME::Tools::IndentingLogger->new($backend_logger);
    
    ### Change indentation level:
    $logger->level(+1);
    
    ### 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");

DESCRIPTION ^

Wrap any logger in an object which will automatically indent the given messages before passing them on.

This is useful in Parsing complex MIME entities: the logged messages can be indented based on how deeply they are nested in the entity.

PUBLIC INTERFACE ^

new LOGGER

Class method, constructor. Create a new logger around the given backend LOGGER.

level [+1|-1]

Instance method. Alter/get current parsing level.

debug MESSAGE...
warning MESSAGE...
error MESSAGE...

Instance methods, concrete overrides. Indent the given messages, then use the backend to log them.