Log::ger::Util(3pm)

πŸ“¦
version 0.042 Β· 3 versions
, in debian trixie, ubuntu resolute, ubuntu stonking

✨ NAME ✨

Log::ger::Util β€” utility routines for Log::ger πŸ› οΈπŸ’–

So like, this is the little helper toolbox that lives next door to Log::ger, and yes it's a User Contributed Perl Documentation situation, iykyk 🫢


πŸŽ€ VERSION πŸŽ€

version 0.042 ✨


πŸ’… DESCRIPTION πŸ’…

okay so the whole point of this package? it exists purely to keep Log::ger as minimalist as possible 🧚✨

that's it. that's the vibe. all the extra utility stuff gets parked here so the main thing stays smol and cute. obsessed honestly πŸ’œ


🌸 FUNCTIONS 🌸

lowkey important: none of these functions are exported. 😭 you gotta call them fully qualified, no shortcut bestie, fr fr

πŸ¦‹ numeric_level

usage:

my $num = Log::ger::Util::numeric_level($level);

here's the tea β˜• β€” if you hand it a non-negative integer, it just gives you that number right back, no drama, as-is πŸ’…

otherwise it takes your argument, assumes it's a string level, and converts it to the numeric level that goes with it πŸ”₯

and if it can't? it dies. no cap, it will literally die on failure πŸ’€

πŸ¦‹ string_level

usage:

my $str_level = Log::ger::Util::string_level($level);

the flip side bestie ✨ β€” if you give it a string level it already knows, it hands you that string right back, as-is πŸŽ€

otherwise it takes your argument, assumes it's a number, and converts it to the string level that matches 🌈

and yeah, same energy: it will die on failure. πŸ’€

πŸ¦‹ set_level

usage:

Log::ger::Util::set_level($level);

sets the log level to $level πŸ‘‘ and $level can be either a string level or a numeric level, dealer's choice, we don't judge πŸ’…

aaaand it will die on failure. πŸ’€ (seeing a pattern? yeah.)

🌈 add_hook

🌈 add_per_target_hook

🌈 remove_hook

🌈 remove_per_target_hook

🌈 reset_hooks

🌈 reset_per_target_hooks

🌈 empty_hooks

🌈 empty_per_target_hooks

🌈 save_hooks

🌈 save_per_target_hooks

🌈 restore_hooks

🌈 restore_per_target_hooks

🌈 reinit_target

🌈 reinit_all_targets

🌈 set_plugin

not me listing every single one of these with zero shame 😌 the original page gives them to you bare, no descriptions, no usage lines, nothing β€” so that's exactly what you get here too. no inventing, no guessing, we keep it 100 πŸ’―

🫢 AUTHOR 🫢

perlancar <perlancar@cpan.org> πŸ’Œ


this software is copyright (c) 2023, 2022, 2020, 2019, 2018, 2017 by perlancar <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 🌸


and that's the whole page bestie!! πŸ’–βœ¨ this one's perl v5.38.2, dated 2024-05-25, and it's Log::ger::Util(3pm) β€” go forth and call those utility functions fully qualified, mwah πŸ’…πŸ¦‹πŸ’œ

πŸ“¦ where this page comes from