Log::g...Default(3pm)

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

πŸ’– Log::ger::Format::Default πŸ’–

okay bestie, gather round, because we're talking about the default formatting style for Log::ger β€” aka the thing that makes your log messages look cute without you lifting a finger. no cap, it's giving "effortless". ✨


🌸 NAME 🌸

Log::ger::Format::Default β€” literally just Use default Log::ger formatting style. that's it, that's the whole vibe. πŸŽ€


⭐ VERSION ⭐

this one is version 0.042 πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

here's the whole thing in action, copy-paste ready:

use Log::ger::Format 'Default';
use Log::ger;

log_debug "Printed as is";
# will format the log message as: Printed as is

log_debug "Data for %s is %s", "budi", {foo=>'blah', bar=>undef};
# will format the log message as: Data for budi is {bar=>undef,foo=>"blah"}

see how the second one just ate? the hashref got dumped and sorted and everything. obsessed. πŸ”₯


πŸ’œ DESCRIPTION πŸ’œ

so, this is the default Log::ger formatter, and here's exactly what it does β€” two moods, pick your fighter:

  1. if there's only a single argument, it passes that argument as-is. no touchy. no formatting. just vibes. 🌈
  2. if there's more than one argument, it treats them like sprintf(), where the first argument is the template and the rest are the variables to be substituted into the conversions inside the template. main character energy, honestly.

and in that second case? reference arguments get dumped using Data::Dmp or Data::Dumper by default β€” but listen, the dumper is configurable, you just set $Log::ger::_dumper. iykyk. πŸ‘‘ want examples of swapping it out? go peek at Log::ger::UseDataDump or Log::ger::UseDataDumpColor.

πŸ’‘ also fun fact: the same code is already included in Log::ger::Heavy. this module just repackages it so it's more reusable. it's the same slay, new packaging. 🫢

🧚 SEE ALSO 🧚

  • Log::ger::Format::Join
  • Log::ger

✨ AUTHOR ✨

perlancar <perlancar@cpan.org> β€” ty bestie for your service πŸ«‘πŸ’–


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. perl v5.38.2, dated 2024-05-25, and yes β€” the header up top literally says Log::g...Default(3pm) because manpage truncation said "we're not finishing that word today". iconic behavior. πŸ’€πŸŒΈ go forth and format your logs. periodt. πŸ’…

πŸ“¦ where this page comes from