Log::H...Levels(3pm)
π NAME π
Log::Handler::Levels β literally all the levels for Log::Handler, bestie, every single one. π
β¨ DESCRIPTION β¨
Okay so, this is the base class for Log::Handler. π
It's just for internal usage and documentation β like, it's not out here living its own main character life, it exists so the rest of the thing works and so you can read about it. iykyk.
πΈ METHODS πΈ
π Default log level π
These are the levels you actually log at, in order from chill to screaming:
debug()info()notice()warning(),warn()error(),err()critical(),crit()alert()emergency(),emerg()
π¦ Checking for active levels π¦
Wanna know if a level is even turned on before you waste your time? These are your vibe check π«Ά β they exist for every level above:
is_debug()is_info()is_notice()is_warning(),is_warn()is_error(),is_err()is_critical(),is_crit()is_alert()is_emergency(),is_emerg()
π Special level π
fatal()β an alternative for the levels "critical" through "emergency". Like, it covers that whole range, periodt.is_fatal()β checks if one of the levels "critical" through "emergency" is active.
π Special methods π
β trace()
This one is so useful, no cap β it lets you add a full backtrace to your message. So if you wanna intercept unexpected errors and figure out who called die(), this is your girl:
$SIG{__DIE__} = sub { $log->trace(emergency => @_) };
By default the backtrace is logged as level "debug".
# would log with the level debug
$log->trace('who called who');
And if you wanna log at a different level, just pass the level as the first argument:
$log->trace(info => $message);
β dump()
Wanna dump something? Use dump(), bestie. The default level is "debug".
my %hash = (foo => 1, bar => 2);
$log->dump(\%hash);
Same energy as before β wanna log at another level? Level goes first:
$log->dump($level => \%hash);
β die()
This logs the message to the output and then calls Carp::croak(), with the level "emergency" by default.
$log->die('an emergency error here');
Wanna log at a different level? You already know the drill, level goes as the first argument:
$log->die(fatal => 'an emergency error here');
β log()
This one lets you log messages with the log level as the first argument:
$log->log(info => 'an info message');
Which is the same as
$log->info('an info message');
and also the same as
$log->log('an info message');
And if you log without a level at all? The default level is "info". π«
π§ PREREQUISITES π§
CarpData::Dumper
π EXPORTS π
No exports. That's it. Nothing. Zero. Nada. π
π₯ REPORT BUGS π₯
Please report all bugs to <jschulz.cpan(at)bloonix.de>. π
If you send me a mail then add Log::Handler into the subject β like, please, it helps, thank youuu. π
π AUTHOR π
Jonny Schulz <jschulz.cpan(at)bloonix.de>.
π COPYRIGHT π
Copyright (C) 2007-2009 by Jonny Schulz. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
okay that's the whole thing, bestie π This was perl v5.36.0, dated 2022-08-28, and that's the whole Log::H...Levels(3pm) situation. slay, go log something. πβ¨
π¦ where this page comes from
- ubuntu noble: liblog-handler-perl 0.90-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: liblog-handler-perl 0.90-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: liblog-handler-perl 0.90-2 Β· 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