Skip to content
This repository has been archived by the owner on Jun 27, 2019. It is now read-only.

Commit

Permalink
run-fbp-tests: Fix bug #1516
Browse files Browse the repository at this point in the history
    According to https://docs.python.org/2/library/logging.html#module-level-functions,
    the logging instantiation in tools/run-fbp-runner is incorrect:
        root = logging.getLogger()
        hdlr = root.handlers[0]
        fmt = logging.Formatter('%(message)s')
        hdlr.setFormatter(fmt)
        hdlr.setLevel(level)

    before invoke getLogger(), python script should call basicConfig() to ensure that at least one handler is available.

Signed-off-by: Lei Yang <lei.a.yang@intel.com>
  • Loading branch information
otcyanglei authored and bdilly committed Mar 3, 2016
1 parent 0902e5f commit 2bbe441
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions tools/run-fbp-tests
Original file line number Diff line number Diff line change
Expand Up @@ -321,11 +321,7 @@ def set_log_level(args):
if not level:
raise ValueError('Invalid log level: %s' % args.log)

root = logging.getLogger()
hdlr = root.handlers[0]
fmt = logging.Formatter('%(message)s')
hdlr.setFormatter(fmt)
hdlr.setLevel(level)
logging.basicConfig(level=level, format='%(message)s')

if __name__ == "__main__":
parser = argparse.ArgumentParser()
Expand Down

0 comments on commit 2bbe441

Please sign in to comment.