Log::ger::Screen - Convenient packaging of Log::ger + Lg:Output::Screen + Lg:Level::FromVar + Lg:Level::FromEnv for one-liner
version 0.005
Mostly in one-liners:
% perl -MLog::ger::Screen -E'log_warn "blah..."; ...'
Set level from package variable (see Log::ger::Level::FromVar for more details):
% perl -E'BEGIN { $Default_Log_Level = 'info' } use Log::ger::Screen; ...'
Set level from environment variable (see Log::ger::Level::FromEnv for more details):
% TRACE=1 perl ...
But you can certainly use this module in your CLI script, as a more lightweight alternative to Log::ger::App when you only want to output log to screen:
#!perl use strict; use warnings; BEGIN { our $Default_Log_Level = 'info' } use Log::ger::Screen; use Log::ger; use Getopt::Long; log_debug "Starting program ..."; ... log_debug "Ending program ...";
This is just a convenient packaging of:
use Log::ger::Level::FromVar; use Log::ger::Level::FromEnv; use Log::ger::Output 'Screen'; use Log::ger; # in the caller's package
mostly for one-liner usage, but you are also welcome to use it in your CLI scripts.
Log::ger::App
Log::ger
Log::ger::Level::FromVar
Log::ger::Level::FromEnv
Log::ger::Output::Screen
perlancar <perlancar@cpan.org>
This software is copyright (c) 2022, 2020 by perlancar <perlancar@cpan.org>.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Log::ger::Screen, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Log::ger::Screen
CPAN shell
perl -MCPAN -e shell install Log::ger::Screen
For more information on module installation, please visit the detailed CPAN module installation guide.