When debugging level of main logger in Pyramid app is set to DEBUG
, transaction
is spewing lots of pointless debug messages.
In Nosetests I can disable that this way:
from transaction._compat import get_thread_ident
txn_logger = logging.getLogger("txn.%d" % get_thread_ident())
txn_logger.setLevel(logging.WARN)
However, in Pyramid app the infrastructure adds "scoped session" to each HTTP request and that obviously means get_thread_ident()
is different every time.
Is there some way of disabling that globally without repeating above in every single Pyramid view?
答案 0 :(得分:1)
只需在日志配置中关闭system
父记录器的日志记录。
txn