Parano...g::File(3pm)
π Paranoid::Log::File β the Perl doc for it, bestie π
okay so this is the page for Paranoid::Log::File, coming at you from the User Contributed Perl Documentation section (section 3pm, for the perl girlies who like their manpages numbered). It's giving "logging but make it paranoid" and honestly? iconic. π
β¨ VERSION β¨
$Id: lib/Paranoid/Log/File.pm, 2.10 2022/03/08 00:01:04 acorliss $
that's the version string, copy it into your bug report verbatim or it doesn't count π
β¨ SYNOPSIS β¨
use Paranoid::Log;
startLogger('events', 'File', PL_DEBUG, PL_GE,
{
file => '/var/log/events.log',
mode => O_TRUNC | O_CREAT | O_RDWR,
perm => 0600,
syslog => 1,
});
literally the whole vibe in six lines. look at that option hash. she's perfect. π¦
β¨ DESCRIPTION β¨
so basically this lets you log to log files. that's the whole thing. it will happily log text of arbitrarily long length β no cap, fr fr β but it also has a syslog mode, which is a whole different girl: that one caps your log lines at 2048 and slaps the standard syslog preamble in front of your text (date/time, host, process name/PID). cute.
The only mandatory option is the file key/value pair. that's it. everything else has a default and she will absolutely pick it for you. π«Ά
This module leverages Paranoid::IO's popen. yes bestie, it's reusing the infrastructure, we love a collaboration.
mode defaults to O_CREAT | O_APPEND | O_WRONLY
perm defaults to 0666 ^ UMASK
syslog defaults to false. Enabling it causes every line to be formatted akin to syslog, along with the 2048 byte limit on messages. so if you turn it on, expect the format glow-up and the length restriction. no cap.
β¨ OPTIONS β¨
these are the keys you can put in the options hash, bestie. here's the lineup π
fileβ string β file name of log file πmodeβ integer β file mode to open withpermβ integer β file permissions of newly created log files πsyslogβ boolean β enable syslog-style format β¨
reminder: file is the only one you have to give her. the rest are optional and will fall back to their defaults.
β¨ SUBROUTINES/METHODS β¨
NOTE: Given that this module is not intended to be used directly nothing is exported.
that's the note, and it's important β don't try to import things from here, she's not that kind of module. π
initlogMsgaddLoggerdelLogger
β¨ DEPENDENCIES β¨
she does not come alone, she comes with a friend group:
FcntlParanoid::DebugParanoid::FilesystemParanoid::InputParanoid::IO
β¨ SEE ALSO β¨
Paranoid::Log
go read that one too, bestie, it's the main character and this one is her supporting cast π
β¨ BUGS AND LIMITATIONS β¨
okay let's be real for a sec. π«Ά
This isn't a high performance module when dealing with a high logging rate with high concurrency. why? the advisory locking requirement and the seeks to the end of the file with every message. every. single. message. so if you're throwing a million logs a second at her with fifty processes, she's gonna be sweating. π
This facility is intended as a kind of lowest-common denominator for programs that need some kind of logging capability. that's the brief. that's the assignment. she's not here to be a speed demon, she's here to be available.
β¨ AUTHOR β¨
Arthur Corliss (corliss@digitalmages.com)
β¨ LICENSE AND COPYRIGHT β¨
This software is free software. Similar to Perl, you can redistribute it and/or modify it under the terms of either:
- the GNU General Public License
https://www.gnu.org/licenses/gpl-1.0.htmlas published by the Free Software Foundationhttp://www.fsf.org/; either version 1https://www.gnu.org/licenses/gpl-1.0.html, or any later versionhttps://www.gnu.org/licenses/license-list.html#GNUGPL, or - the Artistic License 2.0
https://opensource.org/licenses/Artistic-2.0,
subject to the following additional term: No trademark rights to "Paranoid" have been or are conveyed under any of the above licenses. However, "Paranoid" may be used fairly to describe this unmodified software, in good faith, but not as a trademark.
(c) 2005 - 2020, Arthur Corliss (corliss@digitalmages.com) (tm) 2008 - 2020, Paranoid Inc. (www.paranoid.com)
and that's the whole page, bestie!! π the footer said perl v5.38.2 and a date of 2024-03-07, and the title up top was Parano...g::File(3pm) (yes the header truncates the name like that, she's got a character limit and she's abiding by it). mwah, go log something responsibly. πβ¨π
π¦ where this page comes from
- debian trixie: libparanoid-perl 2.10-2 Β· other
- ubuntu resolute: libparanoid-perl 2.10-2 Β· other
- ubuntu stonking: libparanoid-perl 2.10-2 Β· other
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms