Commit 61afbbee authored by Vincent Pelletier's avatar Vincent Pelletier

Fix the ability to run individual test files.

This was broken by r2371: it is good not to import it at file top-level,
but it must still be provided.
Also, fix 'No handler could be found for logger "NEO"' error messages,
which where hiding log messages, by using setupLog.
Also, manually set propagate to 0 so NEO messages are not output by root
logger too.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@2376 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 30e45c93
...@@ -17,8 +17,6 @@ ...@@ -17,8 +17,6 @@
import logging as logging_std import logging as logging_std
# "logging" is available here only once setupLog has been called.
PREFIX = '%(asctime)s %(levelname)-9s %(name)-10s' PREFIX = '%(asctime)s %(levelname)-9s %(name)-10s'
SUFFIX = ' [%(module)14s:%(lineno)3d] %(message)s' SUFFIX = ' [%(module)14s:%(lineno)3d] %(message)s'
...@@ -39,4 +37,8 @@ def setupLog(name='NEO', filename=None, verbose=False): ...@@ -39,4 +37,8 @@ def setupLog(name='NEO', filename=None, verbose=False):
handler.setFormatter(logging_std.Formatter(fmt)) handler.setFormatter(logging_std.Formatter(fmt))
logging.setLevel(level) logging.setLevel(level)
logging.addHandler(handler) logging.addHandler(handler)
logging.propagate = 0
# Create default logger
setupLog()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment