ich habe wieder mal eine Anfängerfrage und komme mit den Informationen die ich im Netz finde nicht wirklich klar.
Ich habe folgendes Muster verwendet:
Code: Alles auswählen
import logging
logger = logging.getLogger()
handler = logging.StreamHandler()
formatter = logging.Formatter(
'%(asctime)s %(name)-12s %(levelname)-8s %(message)s')
handler.setFormatter(formatter)
logger.addHandler(handler)
logger.setLevel(logging.DEBUG)
logger.debug('Logging DEBUG')
logger.error('Logging ERROR')
logger.warning('Logging Warning')
logger.info('Logging INFO')
logger.critical('Logging CRITICAL')Eigentlich möchte ich nur die Meldungen sehen die ich im jeweiligen Lauf erzeuge. Ich konnte aber keinen Weg finden dies umzusetzen.DEBUG:root:Logging DEBUG
2019-01-29 17:32:07,883 root DEBUG Logging DEBUG
2019-01-29 17:32:07,883 root DEBUG Logging DEBUG
2019-01-29 17:32:07,883 root DEBUG Logging DEBUG
ERROR:root:Logging ERROR
2019-01-29 17:32:07,889 root ERROR Logging ERROR
2019-01-29 17:32:07,889 root ERROR Logging ERROR
2019-01-29 17:32:07,889 root ERROR Logging ERROR
WARNING:root:Logging Warning
2019-01-29 17:32:07,889 root WARNING Logging Warning
2019-01-29 17:32:07,889 root WARNING Logging Warning
2019-01-29 17:32:07,889 root WARNING Logging Warning
INFO:root:Logging INFO
2019-01-29 17:32:07,905 root INFO Logging INFO
2019-01-29 17:32:07,905 root INFO Logging INFO
2019-01-29 17:32:07,905 root INFO Logging INFO
CRITICAL:root:Logging CRITICAL
2019-01-29 17:32:07,905 root CRITICAL Logging CRITICAL
2019-01-29 17:32:07,905 root CRITICAL Logging CRITICAL
2019-01-29 17:32:07,905 root CRITICAL Logging CRITICAL
Ich wäre sehr dankbar, wenn mir hier jemand weiterhelfen könnte,
Gruß GEEN
