Log::R...t::Util(3pm)
πΈ Log::R...t::Util β the whole vibe π
okay bestie, welcome to Log::R...t::Util, aka helpful routines to Log::Report β¨ (that's from the Perl 5 user-contributed documentation set, and it's the Log::R...t::Util manual page, so you're in the right place fr fr π«Ά).
𧬠INHERITANCE
Log::R...t::Util is an Exporter π
(yeah she hands out her functions, she's generous like that π)
β¨ SYNOPSIS
my ($language, $territory, $charset, $modifier)
= parse_locale 'nl_BE.utf-8@home';
my @take = expand_reasons 'INFO-ERROR,PANIC';
like look at her, two whole calls and she's already serving ππ₯
π¬ DESCRIPTION
Bestie. Listen. This module is literally just a lil grab-bag of functions and definitions that all the different pieces of the Log::Report infrastructure share between themselves. That's it. That's the whole thing. π«Ά
It's giving internal plumbing, ngl β end-user apps shouldn't need it, so if you're just writing an app you can lowkey skip it. But this man-page does have some genuinely useful background info in it, so stick around if you're curious πβ¨
π§ FUNCTIONS
π§ Reasons
expand_reasons($reasons)
She takes your $reasons string and hands back a sub-set of all existing message reason labels based on what you wrote. Here are the rules, and they are the rules, periodt:
REASONS = BLOCK [ ',' BLOCKS ] | ARRAY-of-REASON
BLOCK = '-' TO | FROM '-' TO | ONE | SOURCE
FROM,TO,ONE = 'TRACE' | 'ASSERT' | ,,, | 'PANIC'
SOURCE = 'USER' | 'PROGRAM' | 'SYSTEM' | 'FATAL' | 'ALL' | 'NONE'
The SOURCE specification groups together all the reasons that are usually related to the problem: it reports about problems caused by the user, reported by the program, or with system interaction. π
example: of expended REASONS π
WARNING-FAULT # == WARNING,MISTAKE,ERROR,FAULT
WARNING,INFO # == WARNING,INFO
-INFO # == TRACE-INFO
ALERT- # == ALERT,FAILURE,PANIC
USER # == MISTAKE,ERROR
ALL # == TRACE-PANIC
FATAL # == ERROR,FAULT,FAILURE,PANIC [1.07]
NONE # ==
no cap, that NONE line really does give you nothing. iconic honestly π
is_fatal($reason)
Returns "true" if the $reason is severe enough to cause an exception (or program termination). β οΈ like, she will end things. literally.
is_reason($name)
Returns "true" if the STRING is one of the predefined REASONS. simple, chic, no notes π
use_errno($reason)
(no description given here, bestie β the manpage just leaves her standing there looking pretty π that's all it says.)
π Modes
Run-modes are explained in Log::Report::Dispatcher. β¨ go read that one too, iykyk.
mode_accepts($mode)
Returns something acceptable by expand_reasons(). π«Ά
mode_number($name|$mode)
Returns the $mode as number. π’
must_show_location($mode, $reason)
(she's here. the manpage doesn't say more than her signature.)
must_show_stack($mode, $reason)
(also here. same deal. π)
π Other
escape_chars(STRING)
Replace all escape characters into their readable counterpart. For instance, a new-line is replaced by backslash-n. π¦
parse_locale(STRING)
Decompose a locale string. π§
For simplicity of the caller's code, the capatization of the returned fields is standardized to the preferred, although the match is case-insensitive as required by the RFC. π The territory is returned in capitals (ISO3166), the language is lower-case (ISO639), the script as upper-case first, the character-set as lower-case, and the modifier and variant unchanged.
In LIST context, four elements are returned: language, territory, character-set (codeset), and modifier. Those four are important for the usual unix translationg infrastructure. Only the "country" is obligatory, the others can be "undef". It may also return "C" and "POSIX". π
In SCALAR context, a HASH is returned which can contain more information: language, script, territory, variant, codeset, and modifiers. The variant (RFC3066 is probably never used). π
pkg2domain( $package, [$domain, $filename, $line] )
With $domain, $filename and $line, this registers a location where the textdomain is specified. Each $package can only belong to one $domain. π monogamy fr fr.
Without these parameters, the registered domain for the $package is returned. π
to_html($string)
[1.02] Escape HTML volatile characters. πΈ
unescape_chars(STRING)
Replace all backslash-something escapes by their escape character. For instance, backslash-t is replaced by a tab character. β¨
π¨ DIAGNOSTICS
- Error: reason
$beginmore serious than$endin$reasonsβ Cast byexpand_reasons(). π yeah she caught you. - Error: unknown locale language in locale
$locale'β Cast byparse_locale(). π - Error: unknown reason
$whichin$reasonsβ Cast byexpand_reasons(). - Error: unknown reason
$whichin$reasonsβ Cast byexpand_reasons(). (yes bestie, it's listed twice up there. i'm not deleting it, i keep the details fr fr π )
π SEE ALSO
This module is part of Log-Report-Optional version 1.08, built on September 08, 2025. Website: http://perl.overmeer.net/CPAN/ π
π LICENSE
For contributors see file ChangeLog. π
This software is copyright (c) 2013-2025 by Mark Overmeer. π
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. π«Ά
and that's the whole page, bestie! π she was rendered by perl v5.40.1 on 2025-10-04, and yes she's still hanging out in the Log::R...t::Util(3pm) corner of the manual π mwah, go read some code now β¨π
π¦ where this page comes from
- ubuntu resolute: liblog-report-optional-perl 1.08-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: liblog-report-optional-perl 1.08-1 Β· 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