-
-
13 Feb 2018 13:37:13 UTC
- Distribution: Piper
- Module version: 0.05
- Source (raw)
- Browse (raw)
- Changes
- Homepage
- How to Contribute
- Repository
- Issues
- Testers (624 / 0 / 0)
- Kwalitee
Bus factor: 0- 97.29% Coverage
- License: apache_2_0
- Perl: v5.10.0
- Activity
24 month- Tools
- Download (53.74KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
NAME
Piper::Logger - Logging and debugging message handler for Piper
CONSTRUCTOR
new
METHODS
DEBUG($segment, $message, @items)
This method is a no-op unless
$self->debug_level($segment) > 0
.Prints an informational message to STDERR.
Uses the method
make_message
to format the printed message according to the debug/verbose levels of$segment
.Labels the message by pre-pending 'Info: ' to the formatted message.
ERROR($segment, $message, @items)
Prints an error to STDERR and dies via Carp::croak.
Uses the method
make_message
to format the printed message according to the debug/verbose levels of$segment
.Labels the message by pre-pending 'Error: ' to the formatted message.
INFO($segment, $message, @items)
This method is a no-op unless
$self->verbose_level($segment) > 0
or$self->debug_level($segment) > 0
.Prints an informational message to STDERR.
Uses the method
make_message
to format the printed message according to the debug/verbose levels of$segment
.Labels the message by pre-pending 'Info: ' to the formatted message.
WARN($segment, $message, @items)
Prints a warning to STDERR via Carp::carp.
Uses the method
make_message
to format the printed message according to the debug/verbose levels of$segment
.Labels the message by pre-pending 'Warning: ' to the formatted message.
UTILITY METHODS
make_message($segment, $message, @items)
Formats and returns the message according to the debug/verbose levels of
$segment
and the provided arguments.There are two-three parts to the message:
segment_name: message <items>
The message part is simply
$message
for all debug/verbose levels.The <items> part is only included when the verbosity level of the segment is greater than 1. It is formatted by Data::Dump.
If the verbosity and debug levels are both 0, segment_name is simply the segment's
label
. If the verbosity level of the segment is greater than zero, the full path of the segment is used instead oflabel
. If the debug level of the segment is greater than 1, the segment'sid
is appended tolabel
/path
in parentheses.debug_level($segment)
verbose_level($segment)
These methods determine the appropriate debug and verbosity levels for the given $segment, while respecting any environment variable overrides.
Available environment variable overrides:
PIPER_DEBUG PIPER_VERBOSE
SEE ALSO
VERSION
version 0.05
AUTHOR
Mary Ehlers <ehlers@cpan.org>
COPYRIGHT AND LICENSE
This software is Copyright (c) 2017 by Mary Ehlers.
This is free software, licensed under:
The Apache License, Version 2.0, January 2004
Module Install Instructions
To install Piper, copy and paste the appropriate command in to your terminal.
cpanm Piper
perl -MCPAN -e shell install Piper
For more information on module installation, please visit the detailed CPAN module installation guide.