MTgeophysics / mtpy

Python toolbox for standard Magnetotelluric (MT) data analysis
GNU General Public License v3.0
145 stars 66 forks source link

Where does the Logging go? #116

Open kujaku11 opened 4 years ago

kujaku11 commented 4 years ago

It looks like there is not place that the logging goes currently.

Expected Behavior

The logging should go to a file that we can look at if something goes wrong or something doesn't behave as it should.

Just need to give a filename to the logging.yml file

Current Behavior

The logging just goes to the console at level of INFO. If I have another logger setup the output goes to that logger, should go to its own logger.

Should log to a file

Possible Solution

Add to the yml file: debug_file_handler: class: logging.handlers.RotatingFileHandler level: DEBUG formatter: standard filename: mtpy_debug.log maxBytes: 2485760 # 2MB backupCount: 2

warning_file_handler:
    class: logging.handlers.RotatingFileHandler
    level: WARNING
    formatter: standard
    filename: mtpy_error.log
    maxBytes: 2485760 # 2MB
    backupCount: 2

Can also specify a file location maybe in users home directory, or MTpy directory.