Steven Haryanto

NAME

Log::Any::For::STDERR - (DEPRECATED) Send output of STDERR to Log::Any

VERSION

version 0.03

SYNOPSIS

 use Log::Any::For::STDERR;

 warn "Also sent to Log::Any";

DESCRIPTION

NOTE: This module is deprecated because log adapters like Log::Any::Adapter::ScreenColoredLevel also outputs to STDERR which prevents this module from working properly. To trap warnings and error messages from Perl, you can instead try installing a $SIG{__WARN__} and $SIG{__DIE__} handler. To capture all STDERR output (including from external programs), you might want to wrap your Perl script and redirect its output; try Process::Govern.

This module will send output of STDERR to Log::Any. Messages are logged at warn level in category STDERR. Messages produced by warn() and print(), among others, will be included. But output of external programs (system(), backtick) are currently not captured because they do not go through PerlIO. Capturing is currently implemented using Tie::STDERR.

VARIABLES

$Log::Any::For::STDERR::Prefix (string, default "STDERR: "). Text to prepend before each output of STDERR.

ENVIRONMENT

LOG_STDERR_PREFIX - Can be used to set $Prefix.

FAQ

SEE ALSO

Of course, Log::Any. See also Log::Any::App which provides an easy way to send your logs to various outputs.

To log other stuffs to Log::Any (besides the normal way of $log->debug() et al, that is), see various other Log::Any::For::* modules.

To capture STDERR there are various ways, including those that utilizes fork and can capture output of external programs. For example, see Capture::Tiny. Also see Process::Govern which, aside from capturing output, also governs other aspects of child process.

AUTHOR

Steven Haryanto <stevenharyanto@gmail.com>

COPYRIGHT AND LICENSE

This software is copyright (c) 2013 by Steven Haryanto.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.