Skip to content

Commit 77a9706

Browse files
authored
Avoid unncessary level setting
1 parent 234a493 commit 77a9706

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Diff for: kubernetes/client/configuration.py

+4
Original file line numberDiff line numberDiff line change
@@ -265,13 +265,17 @@ def debug(self, value):
265265
if self.__debug:
266266
# if debug status is True, turn on debug logging
267267
for _, logger in six.iteritems(self.logger):
268+
if logger.level == logging.DEBUG:
269+
continue
268270
logger.setLevel(logging.DEBUG)
269271
# turn on httplib debug
270272
httplib.HTTPConnection.debuglevel = 1
271273
else:
272274
# if debug status is False, turn off debug logging,
273275
# setting log level to default `logging.WARNING`
274276
for _, logger in six.iteritems(self.logger):
277+
if logger.level == logging.WARNING:
278+
continue
275279
logger.setLevel(logging.WARNING)
276280
# turn off httplib debug
277281
httplib.HTTPConnection.debuglevel = 0

0 commit comments

Comments
 (0)