diff options
author | Daniel Silverstone <daniel.silverstone@codethink.co.uk> | 2019-06-07 13:15:24 +0100 |
---|---|---|
committer | Daniel Silverstone <daniel.silverstone@codethink.co.uk> | 2019-06-07 16:36:13 +0100 |
commit | 6eeb4390b05a8ec2d9e34eb551d7c2b2c7c609da (patch) | |
tree | 48d69e6eca81e4ca574c99bf843812ae42fbdfcd | |
parent | bb53239e18dd2c44bcfe1c47005d910876894dca (diff) | |
download | buildstream-danielsilverstone-ct/microopts.tar.gz |
plugin.py: Don't pay "".format() penalty unless debuggingdanielsilverstone-ct/microopts
The formatting for the debug message in __init__() is a penalty
not worth paying unless debugging.
Signed-off-by: Daniel Silverstone <daniel.silverstone@codethink.co.uk>
-rw-r--r-- | src/buildstream/plugin.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/buildstream/plugin.py b/src/buildstream/plugin.py index d8b6a7359..7361a4bf2 100644 --- a/src/buildstream/plugin.py +++ b/src/buildstream/plugin.py @@ -244,7 +244,8 @@ class Plugin(): # Infer the kind identifier modulename = type(self).__module__ self.__kind = modulename.split('.')[-1] - self.debug("Created: {}".format(self)) + if self.__context.log_debug: + self.debug("Created: {}".format(self)) # If this plugin has been deprecated, emit a warning. if self.BST_PLUGIN_DEPRECATED and not self.__deprecation_warning_silenced(): |