Commit 8760d0c2 authored by Gregory Ashton's avatar Gregory Ashton
Browse files

Merge branch 'master' of gitlab.aei.uni-hannover.de:GregAshton/PyFstat

parents 94067658 c825b5eb
......@@ -51,14 +51,17 @@ parser.add_argument('unittest_args', nargs='*')
args, unknown = parser.parse_known_args()
sys.argv[1:] = args.unittest_args
logger = logging.getLogger()
logger.setLevel(logging.DEBUG)
stream_handler = logging.StreamHandler()
if args.quite:
log_level = logging.WARNING
stream_handler.setLevel(logging.WARNING)
else:
log_level = logging.DEBUG
logging.basicConfig(level=log_level,
format='%(asctime)s %(levelname)-8s: %(message)s',
datefmt='%H:%M')
stream_handler.setLevel(logging.DEBUG)
stream_handler.setFormatter(logging.Formatter(
'%(asctime)s %(levelname)-8s: %(message)s', datefmt='%H:%M'))
logger.addHandler(stream_handler)
def initializer(func):
......@@ -102,6 +105,7 @@ class BaseSearchClass(object):
' Log output to a log-file, requires class to have outdir and label '
logfilename = '{}/{}.log'.format(self.outdir, self.label)
fh = logging.FileHandler(logfilename)
fh.setLevel(logging.INFO)
fh.setFormatter(logging.Formatter(
'%(asctime)s %(levelname)-8s: %(message)s',
datefmt='%y-%m-%d %H:%M'))
......
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