nmcontrol icon indicating copy to clipboard operation
nmcontrol copied to clipboard

Standard logging module

Open JeremyRand opened this issue 10 years ago • 3 comments

The current logging system is pretty inflexible, it doesn't show timestamps, only supports two verbosity levels, and doesn't directly support logging to a file. Python has a standard logging module, has anyone used it before?

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/9105951-standard-logging-module?utm_campaign=plugin&utm_content=tracker%2F435873&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F435873&utm_medium=issues&utm_source=github).

JeremyRand avatar Mar 02 '15 10:03 JeremyRand

+1 http://pastebin.com/k6kHWfrJ

phelixnmc avatar Mar 02 '15 10:03 phelixnmc

I am very happy with this logging configuration: https://github.com/phelix/nameGUI/blob/master/lib/mylogging.py It would also get rid of all 'print' statements, improving py3 compatibility.

phelix avatar Jul 23 '15 15:07 phelix

Suggested procedure:

  • use 2to3 -f print to replace print "foo" by print("foo") everywhere
  • replace print by log.info; implement logging creation function in "common"
  • (optional:) remove if debug statements and replace log.info by log.debug in these places; also set log level in main module

phelixbtc avatar Aug 07 '15 11:08 phelixbtc