Форум сайта python.su
есть лог
from configuration import logging
log = logging.getLogger("MyLog")
format=[%(levelname)s]-%(name)s: %(message)s \n File "%(pathname)s", line %(lineno)d
# create logger
logger = logging.getLogger("simple_example")
logger.setLevel(logging.DEBUG)
# create console handler and set level to debug
ch = logging.StreamHandler()
ch.setLevel(logging.DEBUG)
# create formatter
formatter = logging.Formatter("%(asctime)s - %(name)s - \n %(levelname)s - %(message)s")
# add formatter to ch
ch.setFormatter(formatter)
# add ch to logger
logger.addHandler(ch)
Офлайн
configuration.py
import logging.config
logging.config.fileConfig("logging.properties")
Офлайн
слабо. ни одного ответа, !,,
Офлайн
Люди отдыхают, лето на дворе :)
Напишите в ваш конфиг вот это:
format=[%(levelname)s]-%(name)s: %(message)s
File "%(pathname)s", line %(lineno)d
Офлайн
Спасибо, работает, чувствовал что тупил, и решение должно быть простым.
Офлайн