Logging Kapitel

This commit is contained in:
2023-04-29 16:32:52 +02:00
parent 9f4428cdbc
commit c8b9518c11
14 changed files with 70 additions and 2 deletions

17
teil14/testlogging.py Normal file
View File

@@ -0,0 +1,17 @@
import logging
from conf import __LOGLEVEL__
logging.basicConfig( format='%(asctime)s [%(levelname)s] %(funcName)s: %(message)s',
# filename='test.log',
level=__LOGLEVEL__)
def testlogging():
print('testlogging() aufgerufen.')
logging.debug('DEBUG/Druckdaten werden gesendet.')
logging.info('INFO/Es werden 2 Seiten gedruckt')
logging.warning('WARN/nicht genügend Papier im Drucker')
logging.error('ERROR/Drucker nicht gefunden.')
logging.critical('CRITICAL/Drucker brennt')
if __name__ == '__main__':
testlogging()