-
-
17 Sep 2021 07:10:23 UTC
- Distribution: Catmandu
- Module version: 1.2016
- Source (raw)
- Browse (raw)
- Changes
- Homepage
- How to Contribute
- Repository
- Issues (36)
- Testers (205 / 25 / 3)
- Kwalitee
Bus factor: 4- 87.53% Coverage
- License: perl_5
- Perl: v5.10.1
- Activity
24 month- Tools
- Download (813.62KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
and 18 contributors- Nicolas Steenlant, C<< <nicolas.steenlant at ugent.be> >>
-
Christian Pietsch
-
Dave Sherohman
-
Doug Bell
-
EC2 Default User
-
Jakob Voß
-
Johann Rolschewski
-
Magnus Enger
-
Matthias Vandermaesen
-
Mohammad S Anwar
-
Nicolas Franck
-
Patrick Hochstenbach
-
Pieter De Praetere
-
Snorri Briem
-
Stefan Weil
-
Tom Hukins
-
Upasana Shukla
-
Vitali Peil
- Dependencies
- Any::URI::Escape
- App::Cmd
- CGI::Expand
- Class::Method::Modifiers
- Clone
- Config::Onion
- Cpanel::JSON::XS
- Data::Compare
- Data::Util
- HTTP::Request
- Hash::Merge::Simple
- IO::Handle::Util
- LWP::UserAgent
- List::MoreUtils
- Log::Any
- Log::Any::Adapter
- MIME::Types
- Module::Build
- Module::Info
- Moo
- MooX::Aliases
- Package::Stash
- Parser::MGC
- Path::Iterator::Rule
- Path::Tiny
- Role::Tiny
- Role::Tiny::With
- String::CamelCase
- Sub::Exporter
- Sub::Quote
- Text::CSV
- Text::Hogan::Compiler
- Throwable
- Time::HiRes
- Try::Tiny::ByClass
- URI
- URI::Template
- UUID::Tiny
- Unicode::Normalize
- YAML::XS
- asa
- namespace::clean
- Reverse dependencies
- CPAN Testers List
- Dependency graph
NAME
Catmandu::Fix::log - Log::Any logger as fix
SYNOPSIS
log('test123') log('hello world' , level:WARN)
DESCRIPTION
This fix add debugging capabilities to fixes. To use it via the command line you need to add the '-D' option to your script. E.g.
echo '{}' | catmandu convert -D to YAML --fix 'log("help!", level:WARN)'
By default all logging messages have a level:INFO and will not be displayed unless a log4perl configuration is in place (see below). Using log messages without a log4perl configuration requires a log level of 'WARN', 'ERROR' or 'FATAL'.
CONFIGURATION
To have a full control over the log messages, create a 'catmandu.yml' with a 'log4perl' section as shown below:
$ cat catmandu.yml log4perl: | log4perl.category.Catmandu::Fix::log=TRACE,OUT log4perl.appender.OUT=Log::Log4perl::Appender::Screen log4perl.appender.OUT.stderr=1 log4perl.appender.OUT.utf8=1 log4perl.appender.OUT.layout=PatternLayout log4perl.appender.OUT.layout.ConversionPattern=%d [%P] - %p %l time=%r : %m%n
Using this configuration file all logging messages are written to the screen (stderr output). With this configuration in place use the catmandu command with the -D option to view the logging output:
$ echo '{}' | catmandu convert -D to YAML --fix 'log("help!")' > output.yaml 2> log.txt
The Unix redirections '>' and '2>' can be used to write the output of the catmandu command and the logging in two separate files.
SEE ALSO
Module Install Instructions
To install Catmandu, copy and paste the appropriate command in to your terminal.
cpanm Catmandu
perl -MCPAN -e shell install Catmandu
For more information on module installation, please visit the detailed CPAN module installation guide.