User Tools

Site Tools


python:logging

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
python:logging [2021/08/06 07:31] – created utedasspython:logging [2022/09/12 00:30] (current) – external edit 127.0.0.1
Line 3: Line 3:
 <code python> <code python>
 import logging import logging
 +</code>
 +
 +Logging with getLogger() ar arranged by names. getLogger('father.son.grandson') will use the father log so to say.
 +
 +===== To file =====
 +
 +<code python>
 +import logging
 +
 +logging.basicConfig(filename='example.log', encoding='utf-8', level=logging.DEBUG)
 +
 +logging.debug('This message should go to the log file')
 </code> </code>
  
python/logging.1628235089.txt.gz · Last modified: 2022/09/12 00:30 (external edit)

Except where otherwise noted, content on this wiki is licensed under the following license: CC0 1.0 Universal
CC0 1.0 Universal Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki