Class::Phrasebook Class::Phrasebook 21 of 23 : [PREV] [NEXT]

The Log Classes

Class::Phrasebook uses a Log::LogLite object to generate log messages when errors occur.

However, we might not want to have a log file for our use of the Class::Phrasebook. In this instance we can use the Null Object Design Pattern by Bobby Woolf. The Log::NullLogLite object overrides some of the methods of Log::LogLite to do nothing. So when we call the method write, nothing is written. Because the class inherits from Log::LogLite, the classes that use Log::LogLite continue to run correctly also when we send to them Log::NullLogLite objects.


© 2003 Barbie barbie@missbarbell.co.uk Home http://birmingham.pm.org/