GeoscienceAustralia / eqrm

Automatically exported from code.google.com/p/eqrm
Other
5 stars 4 forks source link

Specifying log level in eqrm_flags #6

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The log module in ANUGA_utilities currently sets the following defaults to set 
up the logger

DefaultConsoleLogLevel = logging.INFO
DefaultFileLogLevel = logging.DEBUG

As per the docstring, these can be set by the consumer like so:

    from eqrm_code.ANUGA_utilities import log

    # configure my logging
    log.console_logging_level = log.INFO
    log.file_logging_level = log.DEBUG
    log.log_filename = './my.log'

    # log away!
    log.debug('A message at DEBUG level')
    log.info('Another message, INFO level')

The user of EQRM may wish to set the log levels themselves. e.g. in a parallel 
environment the user may not wish to have each node status printed to the 
console, but still wish to log as much as possible to file.

The most appropriate place for this is in the eqrm_flags.

This issue is to track the progress of this work.

Original issue reported on code.google.com by b...@girorosso.com on 14 Feb 2012 at 12:19

GoogleCodeExporter commented 9 years ago
Work completed and commited in revision 939.

The new parameters in eqrm_flags are
log_level - string representation of file logging level
console_log_level - string representation of console logging level

The draft user manual has also been updated to reflect these new options.

Original comment by b...@girorosso.com on 16 Feb 2012 at 10:58