mediachain / oldchain-client

[DEPRECATED] old mediachain client experiments
MIT License
4 stars 2 forks source link

replace print statements with logging module #90

Closed yusefnapora closed 8 years ago

yusefnapora commented 8 years ago

89

adds mediachain.utils.log with a config_logging method that sets the log level and lets you optionally enable logging to a file.

when you want to get a logger, you should use mediachain.utils.log.get_logger instead of the default logging.getLogger, so that the current log configuration will be applied.

If you never call config_logging, no log output will be produced; this is the recommended default for libraries, since you want the applications using the lib to determine the log settings.

If you run the mediachain cli, we call config_logging early in mediachain.cli.main, and set the level to the value of the MEDIACHAIN_VERBOSITY env var, or WARNING if that's not set.

vyzo commented 8 years ago

:+1: