Log::H...Screen(3pm)
π 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,STDERRandWARN.WARNmeans to callwarn(). the default isSTDOUT. so if you don't pick, it's screaming into standard out, bestie.dumpβ set this option to1if you want that the message will be dumped withData::Dumperto the screen. like, full-on structured data reveal. π₯utf8,utf-8β setutf8orutf-8onSTDOUTorSTDERR. it depends on the parameterlog_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. π
- <http://perldoc.perl.org/perldiag.html#Malformed-UTF-8-character-(%25s)>
- <http://perldoc.perl.org/Encode.html#UTF-8-vs.-utf8-vs.-UTF8>
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 π«Ά
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
- ubuntu noble: liblog-handler-perl 0.90-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: liblog-handler-perl 0.90-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: liblog-handler-perl 0.90-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms