… | |
… | |
57 | The design goal behind this module was to keep it simple (and small), |
57 | The design goal behind this module was to keep it simple (and small), |
58 | but make it powerful enough to be potentially useful for any module, and |
58 | but make it powerful enough to be potentially useful for any module, and |
59 | extensive enough for the most common tasks, such as logging to multiple |
59 | extensive enough for the most common tasks, such as logging to multiple |
60 | targets, or being able to log into a database. |
60 | targets, or being able to log into a database. |
61 | |
61 | |
|
|
62 | The amount of documentation might indicate otherwise, but the module is |
|
|
63 | still just 240 lines or so. |
|
|
64 | |
62 | =head1 LOGGING FUNCTIONS |
65 | =head1 LOGGING FUNCTIONS |
63 | |
66 | |
64 | These functions allow you to log messages. They always use the caller's |
67 | These functions allow you to log messages. They always use the caller's |
65 | package as a "logging module/source". Also, the main logging function is |
68 | package as a "logging module/source". Also, the main logging function is |
66 | callable as C<AnyEvent::log> or C<AE::log> when the C<AnyEvent> module is |
69 | callable as C<AnyEvent::log> or C<AE::log> when the C<AnyEvent> module is |
… | |
… | |
75 | use Carp (); |
78 | use Carp (); |
76 | use POSIX (); |
79 | use POSIX (); |
77 | |
80 | |
78 | use AnyEvent (); BEGIN { AnyEvent::common_sense } |
81 | use AnyEvent (); BEGIN { AnyEvent::common_sense } |
79 | use AnyEvent::Util (); |
82 | use AnyEvent::Util (); |
|
|
83 | |
|
|
84 | our $VERSION = $AnyEvent::VERSION; |
80 | |
85 | |
81 | our ($now_int, $now_str1, $now_str2); |
86 | our ($now_int, $now_str1, $now_str2); |
82 | |
87 | |
83 | # Format Time, not public - yet? |
88 | # Format Time, not public - yet? |
84 | sub ft($) { |
89 | sub ft($) { |
… | |
… | |
854 | |
859 | |
855 | my $debug = AnyEvent::Debug->AnyEvent::Log::ctx; |
860 | my $debug = AnyEvent::Debug->AnyEvent::Log::ctx; |
856 | $debug->attach ($AnyEvent::Log::Default); |
861 | $debug->attach ($AnyEvent::Log::Default); |
857 | $debug->levels ("trace"); # not "level"! |
862 | $debug->levels ("trace"); # not "level"! |
858 | |
863 | |
|
|
864 | This of course works for any package. |
|
|
865 | |
859 | =back |
866 | =back |
860 | |
867 | |
861 | =head1 AUTHOR |
868 | =head1 AUTHOR |
862 | |
869 | |
863 | Marc Lehmann <schmorp@schmorp.de> |
870 | Marc Lehmann <schmorp@schmorp.de> |