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

tools/run-fbp-tests script raise exception because logging instantiation is incorrect #1516

Closed
otcyanglei opened this issue Mar 2, 2016 · 3 comments

Comments

@otcyanglei
Copy link
Contributor

Task Description

run fbp test with --log option, like:
$ tools/run-fbp-tests --runner "/usr/bin/sol-fbp-runner" --log "DEBUG" "src/test-fbp/"

Dependencies

n/a

Issue Description

The runner tools/run-fbp-tests raise exception and stops when run with --log option:

Traceback (most recent call last):
File "run-fbp-tests", line 354, in
set_log_level(args)
File "run-fbp-tests", line 325, in set_log_level
hdlr = root.handlers[0]
IndexError: list index out of range

Steps to reproduce

  1. $ $ tools/run-fbp-tests --runner "/usr/bin/sol-fbp-runner" --log "DEBUG" "src/test-fbp/"

Board information

n/a

Host OS and architecture:
Ubuntu 14.04 / python 2.7

Target OS and platform:
n/a

Logs

n/a
test script tool issue.

@otcyanglei
Copy link
Contributor Author

According to https://docs.python.org/2/library/logging.html#module-level-functions,
the logging instantiation in tools/run-fbp-runner is incorrect:
324 root = logging.getLogger()
325 hdlr = root.handlers[0]
326 fmt = logging.Formatter('%(message)s')
327 hdlr.setFormatter(fmt)
328 hdlr.setLevel(level)

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

otcyanglei added a commit to otcyanglei/soletta that referenced this issue Mar 2, 2016
    update logging instantiation codes to solve issue when invoke the tools/run-fbp-tests with --log option
    refer to: https://docs.python.org/2/library/logging.html#module-level-functions
@otcyanglei
Copy link
Contributor Author

Submit PR #1517 to fix this issue.

otcyanglei added a commit to otcyanglei/soletta that referenced this issue Mar 3, 2016
    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>
otcyanglei added a commit to otcyanglei/soletta that referenced this issue Mar 3, 2016
    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>
bdilly pushed a commit that referenced this issue Mar 3, 2016
    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>
@bdilly
Copy link
Contributor

bdilly commented Mar 3, 2016

PR #1517 was integrated, so I'm closing this issue.
Thanks

@bdilly bdilly closed this as completed Mar 3, 2016
tripzero pushed a commit to tripzero/soletta that referenced this issue Mar 11, 2016
    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>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants