Skip to content

Conversation

@boegel
Copy link
Member

@boegel boegel commented Mar 3, 2016

getRootLoggerName() always returns "not available in optimized mode" when it is run under python -O (i.e., when __debug__ is False), so it makes no sense to include it to construct the "full logger name"

@stdweird
Copy link
Member

stdweird commented Mar 3, 2016

what does this change?

@stdweird
Copy link
Member

stdweird commented Mar 3, 2016

sorry, didn't read the description 😄

@stdweird
Copy link
Member

stdweird commented Mar 3, 2016

test this please

@boegel
Copy link
Member Author

boegel commented Mar 3, 2016

In the case of EasyBuild (where python -O is used/$PYTHONOPTIMIZE is set), you get this as log messages:

== 2016-03-03 09:52:17,768 tools.robot INFO Using robot path(s): ['/Users/kehoste/work/easybuild-easyconfigs/easybuild/easyconfigs']

instead of this:

== 2016-03-03 09:52:17,768 not available in optimized mode.tools.robot INFO Using robot path(s): ['/Users/kehoste/work/easybuild-easyconfigs/easybuild/easyconfigs']

If python -O is not used, it doesn't change anything.

@boegel
Copy link
Member Author

boegel commented Mar 3, 2016

Please hold off merging this a little bit, since this breaks some nasty bit of code eb:

Traceback (most recent call last):
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/Users/kehoste/work/easybuild-framework/easybuild/main.py", line 47, in <module>
    from easybuild.tools.build_log import EasyBuildError, init_logging, print_msg, print_error, stop_logging
  File "easybuild/tools/build_log.py", line 182, in <module>
    del _init_fancylog.manager.loggerDict[_init_fancylog.name]
KeyError: 'root'

@boegel
Copy link
Member Author

boegel commented Mar 3, 2016

Jenkins: test this please

@hpcugentbot
Copy link

One or more tests FAILed.

See https://jenkins1.ugent.be/job/vsc-base-prbuilder/23/console for more details.

@hpcugentbot
Copy link

All tests PASSed.

See https://jenkins1.ugent.be/job/vsc-base-prbuilder/25/console for more details.

@boegel
Copy link
Member Author

boegel commented Mar 3, 2016

OK, this is not going to work, apparently the root logger name is key, even under python -O when it's "not available in debug mode"...

I'll figure out another way to get rid of the "not available in debug mode" in the EB logs.

@boegel boegel closed this Mar 3, 2016
@boegel boegel deleted the no_root_logger_name branch March 3, 2016 09:53
@boegel
Copy link
Member Author

boegel commented Mar 3, 2016

superior solution in EB is to simply not include the logger name, but log location instead: easybuilders/easybuild-framework#1649

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants