1Log::Any::Adapter::UtilU(s3e)r Contributed Perl DocumentaLtoigo:n:Any::Adapter::Util(3)
2
3
4
6 Log::Any::Adapter::Util - Common utility functions for Log::Any
7
9 version 1.707
10
12 This module has utility functions to help develop Log::Any::Adapter
13 subclasses or Log::Any::Proxy formatters/filters. It also has some
14 functions used in internal testing.
15
17 logging_methods
18 Returns a list of all logging method. E.g. "trace", "info", etc.
19
20 detection_methods
21 Returns a list of detection methods. E.g. "is_trace", "is_info", etc.
22
23 logging_and_detection_methods
24 Returns a list of logging and detection methods (but not aliases).
25
26 log_level_aliases
27 Returns key/value pairs mapping aliases to "official" names. E.g.
28 "err" maps to "error".
29
30 logging_aliases
31 Returns a list of logging alias names. These are the keys from
32 "log_level_aliases".
33
34 detection_aliases
35 Returns a list of detection aliases. E.g. "is_err", "is_fatal", etc.
36
37 numeric_level
38 Given a level name (or alias), returns the numeric value described
39 above under log level constants. E.g. "err" would return 3.
40
41 dump_one_line
42 Given a reference, returns a one-line Data::Dumper dump with keys
43 sorted.
44
45 make_method
46 Given a method name, a code reference and a package name, installs the
47 code reference as a method in the package.
48
49 require_dynamic (DEPRECATED)
50 Given a class name, attempts to load it via require unless the class
51 already has a constructor available. Throws an error on failure. Used
52 internally and may become private in the future.
53
54 read_file (DEPRECATED)
55 Slurp a file. Does *not* apply any layers. Used for testing and may
56 become private in the future.
57
58 cmp_deeply (DEPRECATED)
59 Compares dump_one_line results for two references. Also takes a test
60 label as a third argument. Used for testing and may become private in
61 the future.
62
64 Nothing is exported by default.
65
66 Log level constants
67 If the ":levels" tag is included in the import list, the following
68 numeric constants will be imported:
69
70 EMERGENCY => 0
71 ALERT => 1
72 CRITICAL => 2
73 ERROR => 3
74 WARNING => 4
75 NOTICE => 5
76 INFO => 6
77 DEBUG => 7
78 TRACE => 8
79
81 · Jonathan Swartz <swartz@pobox.com>
82
83 · David Golden <dagolden@cpan.org>
84
85 · Doug Bell <preaction@cpan.org>
86
87 · Daniel Pittman <daniel@rimspace.net>
88
89 · Stephen Thirlwall <sdt@cpan.org>
90
92 This software is copyright (c) 2017 by Jonathan Swartz, David Golden,
93 and Doug Bell.
94
95 This is free software; you can redistribute it and/or modify it under
96 the same terms as the Perl 5 programming language system itself.
97
98
99
100perl v5.30.0 2019-07-26 Log::Any::Adapter::Util(3)