don't call out to prohibitively expensive getRootLoggerName in getLogger, just use 'root' instead #3074
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The calls to
getRootLoggerName
are very expensive when__debug__
isTrue
, since then it relies heavily on Python'sinspect
module.For some reason unclear to me, the easyconfig tests that run in GitHub CI with Python 3.6 and 3.7 trigger the path that corresponds with
__debug__
beingFalse
, despite running underpython -O
(and also defining$PYTHONOPTIMIZE
doesn't help).Regardless, I think it's fine to strip out the call to
getRootLoggerName
and just use a fixed'root'
name instead.For normal use of EasyBuild via the
eb
command, this doesn't make a difference (since thenpython -O
is used under the covers, and the name of the root logger isn't actually visible anywhere by default unless the%(name)s
template is used in the log format set viasetLogFormat
).This minor change will significantly speed up the easyconfig tests though, when
getRootLoggerName
follows the path toinspect
...