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

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

πŸ’– Log::Handler::Output::Screen πŸ’–

okay bestie, so this is Log::H...Screen(3pm), a page from the User Contributed Perl Documentation, and it's literally all about yeeting your log messages at the screen. that's it. that's the whole vibe. no cap. πŸ–₯️✨

πŸ¦‹ NAME πŸ¦‹

Log::Handler::Output::Screen β€” Log messages to the screen.

🌸 SYNOPSIS 🌸

use Log::Handler::Output::Screen;

my $screen = Log::Handler::Output::Screen->new(
    log_to => "STDERR",
    dump   => 1,
);

$screen->log($message);

πŸ‘‘ DESCRIPTION πŸ‘‘

This output module makes it possible to log messages to your screen. so like, your program has thoughts and feelings, and this thing lets it say them out loud instead of keeping them inside. main character energy fr. πŸ’…


πŸŽ€ METHODS πŸŽ€

new()

Call new() to create a new Log::Handler::Output::Screen object. it's giving birth to a tiny screen-logging baby. 🍼

The following options are possible:

  • log_to β€” where do you want to log? possible values are: STDOUT, STDERR and WARN. WARN means to call warn(). the default is STDOUT. so if you don't pick, it's screaming into standard out, bestie.
  • dump β€” set this option to 1 if you want that the message will be dumped with Data::Dumper to the screen. like, full-on structured data reveal. πŸ”₯
  • utf8, utf-8 β€” set utf8 or utf-8 on STDOUT or STDERR. it depends on the parameter log_to. here's the tea:
utf8   =  binmode, $fh, ":utf8";
utf-8  =  binmode, $fh, "encoding(utf-8)";

Yes, there is a difference. they are NOT the same thing, and if you treat them like they are, that's on you. 😭

log()

Call log() if you want to log a message to the screen. this is the moment. the whole point. πŸ“£

Example:

$screen->log("this message goes to the screen");

validate()

Validate a configuration. it checks that your config isn't a mess before you commit to it. 🧚

reload()

Reload with a new configuration. glow-up for your settings. ✨

errstr()

This function returns the last error message. so when things go wrong, this is where the receipts live. πŸ’€


πŸ“ PREREQUISITES πŸ“

Data::Dumper
Params::Validate

🌈 EXPORTS 🌈

No exports. nothing leaves the house. not a single symbol. πŸ™ˆ


πŸ’œ 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, put it in the subject line or the mail might get lost in the void fr fr. πŸ“¬

⭐ 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 iconic that a 2007-2009 copyright is still out here logging to your screen. periodt. πŸ‘‘

and that's the whole page, babes β€” brought to you by perl v5.36.0, dated 2022-08-28, and signed off as Log::H...Screen(3pm) because that title was simply too long to fit. slay. πŸ’–βœ¨

πŸ“¦ where this page comes from