24 Sep 2002 12:41:24 UTC
- Distribution: Log-LogLite
- Module version: 0.82
- Source (raw)
- Browse (raw)
- How to Contribute
- Issues (2)
- Testers (6654 / 3 / 0)
- KwaliteeBus factor: 0
- 70.86% Coverage
- License: unknown
- Activity24 month
- Download (5.58KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest version
Log::NullLogLite - The
Log::NullLogLiteclass implements the Null Object pattern for the
use Log::NullLogLite; # create new Log::NullLogLite object my $log = new Log::NullLogLite(); ... # we had an error (this entry will not be written to the log # file because we use Log::NullLogLite object). $log->write("Could not open the file ".$file_name.": $!", 4);
Log::NullLogLiteclass is derived from the
Log::LogLiteclass and implement the Null Object Pattern to let us to use the
Log::LogLiteclass with null
Log::LogLiteobjects. We might want to do that if we use a
Log::LogLiteobject in our code, and we do not want always to actually define a
Log::LogLiteobject (i.e. not always we want to write to a log file). In such a case we will create a
Log::NullLogLiteobject instead of the
Log::LogLiteobject, and will use that object instead. The object has all the methods that the
Log::LogLiteobject has, but those methods do nothing. Thus our code will continue to run without any change, yet we will not have to define a log file path for the
Log::LogLiteobject, and no log will be created.
- new ( FILEPATH [,LEVEL [,DEFAULT_MESSAGE ]] )
The constructor. The parameters will not have any affect. Returns the new Log::NullLogLite object.
- write( MESSAGE [, LEVEL ] )
Does nothing. The parameters will not have any affect. Returns nothing.
- level( [ LEVEL ] )
Does nothing. The parameters will not have any affect. Returns -1.
- default_message( [ MESSAGE ] )
Does nothing. The parameters will not have any affect. Returns empty string ("").
Rani Pinchuk, email@example.com
Copyright (c) 2001-2002 Ockham Technology N.V. & Rani Pinchuk. All rights reserved. This package is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Log::LogLite(3), The Null Object Pattern - Bobby Woolf - PLoP96 - published in Pattern Languages of Program Design 3 (http://cseng.aw.com/book/0,,0201310112,00.html)
1 POD Error
The following errors were encountered while parsing the POD:
- Around line 128:
You forgot a '=back' before '=head1'