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

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

πŸ’– Log::H...::YAML β€” aka Log::Handler::Plugin::YAML(3pm) πŸ’–

okay bestie, sit down, hydrate, and let me tell you about the cutest little YAML config loader in the Perl ecosystem. This is Log::Handler::Plugin::YAML, and its whole personality is: "you give me a YAML file, I give you a config ref." That's it. That's the vibe. It's a config loader for YAML, periodt. ✨


🌸 NAME 🌸

Log::Handler::Plugin::YAML β€” a config loader for YAML. it loads configs. from YAML. she's simple, she's focused, she minds her own business. πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

the way you use this is literally two lines, no notes:

use Log::Handler::Plugin::YAML;

my $config = Log::Handler::Plugin::YAML->get_config( $config_file );

see? iconic. you use it, then you call get_config on the class and hand it a $config_file. done. πŸ’…


πŸ‘‘ ROUTINES πŸ‘‘

✨ get_config() ✨

she expects the config file name, and she hands you back the config as a reference. that's the whole deal, fr fr. one arg in, one ref out. 🫢


πŸ“ CONFIG STYLE πŸ“

here's what a config can look like, and no I did not make this up, this is canon:

---
file:
  mylog:
    debug_mode: 2
    filename: example.log
    fileopen: 1
    maxlevel: info
    minlevel: warn
    mode: append
    newline: 1
    permissions: 0640
    message_layout: %T %H[%P] [%L] %S: %m
    reopen: 1
    timeformat: %b %d %H:%M:%S

look at her. nesting so clean, so structured, so main character. 🧚


🌈 PREREQUISITES 🌈

  • YAML β€” yeah bestie, you gotta have it. no YAML module, no YAML parsing. that's just the rules. πŸ’œ

πŸŽ€ EXPORTS πŸŽ€

No exports.

nope! nothing! she exports nothing! your namespace stays untouched, your vibes stay pristine. πŸ™ˆ


πŸ’€ REPORT BUGS πŸ’€

Please report all bugs to <jschulz.cpan(at)bloonix.de>.

and if you send me a mail then add Log::Handler into the subject β€” no cap, this is important, do not skip the subject line, the author is literally asking nicely. πŸ“§


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


lowkey a whole legal moment but make it slay. free software, same terms as Perl, we love to see it. 🫢

and that's the page, bestie! this was Log::H...::YAML(3pm) from perl v5.36.0, dated 2022-08-28 β€” go load some YAML configs and be the main character of your own log files. mwah. πŸ’‹πŸŒΈβœ¨

πŸ“¦ where this page comes from