Simple(3pm)

πŸ“¦
version 2.0 Β· 2 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble

πŸ¦‹ Simple(3pm) β€” the Logger::Simple manual, bestie edition πŸ¦‹

okay so this is the page for Logger::Simple, and it lives in the User Contributed Perl Documentation corner of your man pages. It's a Perl module (hence the 3pm), and it's literally an implementation of the Simran-Log-Log and Simran-Error-Error modules. we're logging. we're vibing. let's go πŸ’–


✨ NAME ✨

Logger::Simple β€” Implementation of the Simran-Log-Log and Simran-Error-Error modules

🌸 SYNOPSIS 🌸

use Logger::Simple;
my $log=Logger::Simple->new(LOG=>"/tmp/program.log");
my $x=5;my $y=4;

if($x>$y){
  $log->write("\$x is greater than \$y");
}

πŸ’œ DESCRIPTION πŸ’œ

okay here's the whole cast of methods, no skips, no skimming, we're covering all of them πŸ’…

  • new β€” "my $log=Logger::Simple->new(LOG=>"/tmp/logfile");"

this one builds your Logger::Simple object, and it does it as an inside-out object (iykyk). the Log parameter is mandatory β€” you HAVE to pass it at creation time or the object will just fail, no cap. and the second it's created, this method also calls the open_log method, which opens the log file. so like, it's already handling the file opening for you. icon behavior honestly.

  • write β€” "$log->write("This is an error message");"

this writes a message to the logfile, and it also updates the internal HISTORY array. so your message is saved and remembered. main character of the log, fr fr.

  • retrieve_history β€” "my @history = $log->retrieve_history;" and "my $msg = $log->retrieve_history;"

context matters here, bestie. when you call it in scalar context, it hands you back the last message written to the HISTORY array. when you call it in list context, it returns the entire HISTORY array. one or all, you decide. ✨

  • clear_history β€” "$log->clear_history;"

this one wipes the internal HISTORY array. clean slate, fresh start, no receipts left behind 🧚

πŸŽ€ EXPORT πŸŽ€

None by default.

(yeah. nothing. it exports nothing unless you ask. very low-maintenance of it.)

🫢 ACKNOWLEDGEMENTS 🫢

this module is based on the Simran::Log::Log and Simran::Error::Error modules. the author liked the principle behind them, but felt the interface could be a bit better. and honestly? valid. improvement arc. πŸ‘‘

also a big thanks goes out once again to Damian Conway for Object Oriented Perl, and to Sam Tregar for his book "Writing Perl Modules for CPAN". both were invaluable references. πŸ“

and shoutout to Jerry Heden for his Object::InsideOut module, which was used to create this module. king behavior.

🌈 AUTHOR 🌈

Thomas Stanley

Thomas_J_Stanley@msn.com

you can also find him on http://www.perlmonks.org as TStanley. and yes, you can direct any questions concerning this module there as well. slide into the monks, bestie πŸ’Œ

this section exists in the original page but has no content underneath it. nothing. a void. a little blank space where a copyright notice would go. we're just noting that so nobody thinks we skipped it πŸ™ˆ

⭐ SEE ALSO ⭐

  • perl(1).
  • Object::InsideOut
  • Simran::Log::Log
  • Simran::Error::Error

and that's the whole page!! this one's from perl v5.30.0, dated 2020-01-28, and yeah it's Simple(3pm) β€” which is a little bit of a lie because logging is never that simple, but we love it anyway πŸ’–πŸ¦‹βœ¨

πŸ“¦ where this page comes from