Catman...x::log(3pm)
β¨ NAME β¨
Catmandu::Fix::log β it's a Log::Any logger, but make it a fix π
π SYNOPSIS π
log('test123')
log('hello world' , level:WARN)
π DESCRIPTION π
okay so bestie, this fix is literally here to add debugging capabilities to your fixes. it's giving "console.log but make it catmandu" π¦
to use it from the command line you need to add the -D option to your script. like, for example:
echo '{}' | catmandu convert -D to YAML --fix 'log("help!", level:WARN)'
by default, all logging messages have a level of level:INFO and will NOT be displayed unless a log4perl configuration is in place (scroll down, it's below π). so if you're out here using log messages with no log4perl configuration at all, you need a log level of 'WARN', 'ERROR' or 'FATAL'. those are the only ones that will show up, no cap. π
πΈ CONFIGURATION πΈ
if you want full control over your log messages, create a catmandu.yml with a log4perl section, exactly like this:
$ 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
with this configuration file in place, all your logging messages get written to the screen (that's stderr output, bestie π). and once you've got this config living in your project, run the catmandu command with the -D option to actually see the logging output:
$ echo '{}' | catmandu convert -D to YAML --fix 'log("help!")' > output.yaml 2> log.txt
the Unix redirections '>' and '2>' are your besties here β use them to write the output of the catmandu command and the logging into two separate files. iconic, honestly. π
π¦ SEE ALSO π¦
Catmandu::FixCatmandu::LoggerLog::log4perl
perl v5.40.1 Β· 2026-01-24 β that's the version and date this page was born, and it's the end of the manpage, so byeee π«Ά stay logged, stay iconic, periodt πβ¨
π¦ where this page comes from
- ubuntu resolute: libcatmandu-perl 1.2025-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libcatmandu-perl 1.2025-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms