1Resurrector(3) User Contributed Perl Documentation Resurrector(3)
2
3
4
6 Log::Log4perl::Resurrector - Dark Magic to resurrect hidden L4p
7 statements
8
10 Loading "use Log::Log4perl::Resurrector" causes subsequently loaded
11 modules to have their hidden
12
13 ###l4p use Log::Log4perl qw(:easy);
14
15 ###l4p DEBUG(...)
16 ###l4p INFO(...)
17 ...
18
19 statements uncommented and therefore 'resurrected', i.e. activated.
20
21 This allows for a module "Foobar.pm" to be written with Log4perl
22 statements commented out and running at full speed in normal mode.
23 When loaded via
24
25 use Foobar;
26
27 all hidden Log4perl statements will be ignored.
28
29 However, if a script loads the module "Foobar" after loading
30 "Log::Log4perl::Resurrector", as in
31
32 use Log::Log4perl::Resurrector;
33 use Foobar;
34
35 then "Log::Log4perl::Resurrector" will have put a source filter in
36 place that will extract all hidden Log4perl statements in "Foobar"
37 before "Foobar" actually gets loaded.
38
39 Therefore, "Foobar" will then behave as if the
40
41 ###l4p use Log::Log4perl qw(:easy);
42
43 ###l4p DEBUG(...)
44 ###l4p INFO(...)
45 ...
46
47 statements were actually written like
48
49 use Log::Log4perl qw(:easy);
50
51 DEBUG(...)
52 INFO(...)
53 ...
54
55 and the module "Foobar" will indeed be Log4perl-enabled. Whether any
56 activated Log4perl statement will actually trigger log messages, is up
57 to the Log4perl configuration, of course.
58
59 There's a startup cost to using "Log::Log4perl::Resurrector" (all
60 subsequently loaded modules are examined) but once the compilation
61 phase has finished, the perl program will run at full speed.
62
63 Some of the techniques used in this module have been stolen from the
64 "Acme::Incorporated" CPAN module, written by chromatic. Long live CPAN!
65
67 Copyright 2002-2013 by Mike Schilli <m@perlmeister.com> and Kevin Goess
68 <cpan@goess.org>.
69
70 This library is free software; you can redistribute it and/or modify it
71 under the same terms as Perl itself.
72
74 Please contribute patches to the project on Github:
75
76 http://github.com/mschilli/log4perl
77
78 Send bug reports or requests for enhancements to the authors via our
79
80 MAILING LIST (questions, bug reports, suggestions/patches):
81 log4perl-devel@lists.sourceforge.net
82
83 Authors (please contact them via the list above, not directly): Mike
84 Schilli <m@perlmeister.com>, Kevin Goess <cpan@goess.org>
85
86 Contributors (in alphabetical order): Ateeq Altaf, Cory Bennett, Jens
87 Berthold, Jeremy Bopp, Hutton Davidson, Chris R. Donnelly, Matisse
88 Enzer, Hugh Esco, Anthony Foiani, James FitzGibbon, Carl Franks, Dennis
89 Gregorovic, Andy Grundman, Paul Harrington, Alexander Hartmaier David
90 Hull, Robert Jacobson, Jason Kohles, Jeff Macdonald, Markus Peter,
91 Brett Rann, Peter Rabbitson, Erik Selberg, Aaron Straup Cope, Lars
92 Thegler, David Viner, Mac Yang.
93
94
95
96perl v5.32.0 2020-09-07 Resurrector(3)