Perl Diver 2.33
Main Environment Variables Perl Default Values Perl Config - Summary Perl Config - Full Installed Modules List Directory uptime Docs

Module Documentation
Details and documentation about a specific module, including version and documentation (if available). Note that while links to perldoc.com and search.cpan.org are provided, the module may be part of a larger distribution. If you reach a File Not Found page on either site, please try the parent module.

Log::Any::Adapter::Screen

Name Log::Any::Adapter::Screen
Version 0.140
Located at /usr/share/perl5
File /usr/share/perl5/Log/Any/Adapter/Screen.pm
Is Core No
Search CPAN for this module Log::Any::Adapter::Screen
Documentation Log::Any::Adapter::Screen
Module Details Log::Any::Adapter::Screen


NAME

Log::Any::Adapter::Screen - Send logs to screen, with colors and some other features


VERSION

This document describes version 0.140 of Log::Any::Adapter::Screen (from Perl distribution Log-Any-Adapter-Screen), released on 2018-12-22.


SYNOPSIS

 use Log::Any::Adapter;
 Log::Any::Adapter->set('Screen',
     # min_level => 'debug', # default is 'warning'
     # colors    => { trace => 'bold yellow on_gray', ... }, # customize colors
     # use_color => 1, # force color even when not interactive
     # stderr    => 0, # print to STDOUT instead of the default STDERR
     # formatter => sub { "LOG: $_[1]" }, # default none
 );


DESCRIPTION

This Log::Any adapter prints log messages to screen (STDERR/STDOUT). The messages are colored according to level (unless coloring is turned off). It has a few other features: allow passing formatter, allow setting level from some environment variables, add prefix/timestamps.

Parameters:


ENVIRONMENT

NO_COLOR

If defined, will disable color. Consulted before COLOR.

COLOR

Can be set to 0 to explicitly disable colors. The default is to check for <-t STDOUT>.

LOG_LEVEL => str

QUIET => bool

VERBOSE => bool

DEBUG => bool

TRACE => bool

These environment variables can set the default for min_level. See documentation about min_level for more details.

LOG_PREFIX => str

The default formatter groks these variables. See documentation about formatter about more details.


HOMEPAGE

Please visit the project's homepage at https://metacpan.org/release/Log-Any-Adapter-Screen.


SOURCE

Source repository is at https://github.com/perlancar/perl-Log-Any-Adapter-ScreenColoredLevel.


BUGS

Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=Log-Any-Adapter-Screen

When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.


SEE ALSO

Originally inspired by the Log::Log4perl::Appender::ScreenColoredLevel manpage. The old name for this adapter is Log::Any::Adapter::ScreenColoredLevel but at some point I figure using a shorter name is better for my fingers.

the Log::Any manpage

the Log::Log4perl::Appender::ScreenColoredLevel manpage

the Term::ANSIColor manpage


AUTHOR

perlancar <perlancar@cpan.org>


COPYRIGHT AND LICENSE

This software is copyright (c) 2018, 2016, 2015, 2014, 2012, 2011 by 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.

Perl Diver brought to you by ScriptSolutions.com © 1997- 2026