Package nMOLDYN :: Package Core :: Module Logger :: Class LogToFile |
[hide private]
[frames] | no frames]

# Class LogToFile

source code

    logging.Filterer --+
                       |
         logging.Handler --+
                           |
       logging.StreamHandler --+
                               |
             logging.FileHandler --+
                                   |
                                  LogToFile

Sets up a file logger.

Emits the logging messages to a file.

Instance Methods | [hide private]
__init__(self, fileName) The constructor. | source code
emit(self, record) Emits the logging message in a file. | source code
close(self) Closes the file logger. | source code
Inherited from `logging.StreamHandler`: `flush` Inherited from `logging.Handler`: `acquire`, `createLock`, `format`, `handle`, `handleError`, `release`, `setFormatter`, `setLevel` Inherited from `logging.Filterer`: `addFilter`, `filter`, `removeFilter`

Method Details | [hide private]

### __init__(self, fileName) (Constructor) | source code
The constructor. Sets the logger. Parameters: `fileName` (string) - the name of the file where all the logging messages will be emitted. Overrides: logging.Filterer.__init__

### emit(self, record) | source code
Emits the logging message in a file. Parameters: `record` (instance of LogRecord class.) - the logging message. Overrides: logging.Handler.emit

### close(self) | source code
Closes the file logger. Overrides: logging.Handler.close