GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Badger::Log::File(3) User Contributed Perl Documentation Badger::Log::File(3)

Badger::Log::File - writes log messages to a log file

    use Badger::Log::File;
    
    my $log = Badger::Log::File->new({
        filename  => '/var/log/badger.log',
        keep_open => 1,
    });
        
    $log->log('a debug message');
    $log->info('an info message');
    $log->warn('a warning message');
    $log->error('an error message');
    $log->fatal('a fatal error message');

This module is a subclass of Badger::Log that implements a simple mechanism for logging messages to a file. It uses Badger::Filesystem for all the underlying file operations.

The following configuration options are available in addition to those inherited form the Badger::Log base class.

The name of the log file which you want messages appended to. This parameter is mandatory.

An optional reference to a Badger::Filesystem object, or the name of a filesystem class having a file() method similar to that in Badger::Filesystem. This defaults to the Badger::Filesystem class.

A flag indicating if the log file should be kept open between calls to logging methods. The default value is 0 meaning that the file will be opened for each message and closed again afterwards. Set it to any true value to have the file kept open.

The following methods are implemented in addition to those inherited from Badger::Log and its base classes.

This method redefines the log() method in Badger::Log to write logging messages to the log file.

Custom initialiser method which calls the base class init_log() method followed by the init_file() method.

Custom initialiser method which handles the configuration and initialisation of the file-specific parts of the logger.

This method acquires a file handle (an IO::File object) for the specified filename, opened ready for appending log messages.

The method releases a previously acquired file handle. i.e. it closes the log file.

Andy Wardley <http://wardley.org/>

Copyright (C) 2005-2009 Andy Wardley. All Rights Reserved.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

Badger::Log
2016-12-12 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.