Log::H...Levels(3pm)

πŸ“¦
version 0.90 Β· 5 versions
, in ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– 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 🧚

  • Carp
  • Data::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 (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