NAME

Piper::Role::Logger - Role for logging and debugging in the Piper system

DESCRIPTION

The role exists to support future subclassing and testing of the logging mechanism used by Piper.

REQUIRES

This role requires the definition of the below methods, each of which will be provided the following arguments:

  $segment  # The pipeline segment calling the method
  $message  # The message sent (a string)
  @items    # Items that provide context to the message

DEBUG

This method is only called if the debug level of the segment is greater than zero.

ERROR

This method should cause a die or croak. It will do so automatically if not done explicitly, though with an extremely generic and unhelpful message.

INFO

This method is only called if either the verbosity or debug levels of the segment are greater than zero.

WARN

This method should issue a warning (such as warn or carp).

UTILITY METHODS

debug_level($segment)

verbose_level($segment)

These methods should be used to determine the appropriate debug and verbosity levels for the logger. They honor the following environment variable overrides (if they exist) before falling back to the appropriate levels set by the given $segment:

    PIPER_DEBUG
    PIPER_VERBOSE

SEE ALSO

Piper::Logger
Piper

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