Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _acceptable_level(self, level):
if self._levels is None:
target_level = log_levels.index(_log_level)
self._levels = [
self.to_tx[lvl]
for lvl in log_levels
if log_levels.index(lvl) <= target_level and lvl != "none"
]
return level in self._levels
def _acceptable_level(self, level):
if self._levels is None:
target_level = log_levels.index(_log_level)
self._levels = [
self.to_tx[lvl]
for lvl in log_levels
if log_levels.index(lvl) <= target_level and lvl != "none"
]
return level in self._levels
def _acceptable_level(self, level):
if self._levels is None:
target_level = log_levels.index(_log_level)
self._levels = [
self.to_tx[lvl]
for lvl in log_levels
if log_levels.index(lvl) <= target_level and lvl != "none"
]
return level in self._levels
def _set_log_level(self, level):
# up to the desired level, we don't do anything, as we're a
# "real" Twisted new-logger; for methods *after* the desired
# level, we bind to the no_op method
desired_index = log_levels.index(level)
for (idx, name) in enumerate(log_levels):
if name == 'none':
continue
if idx > desired_index:
current = getattr(self, name, None)
if not current == _no_op or current is None:
setattr(self, name, _no_op)
if name == 'error':
setattr(self, 'failure', _no_op)
else:
if getattr(self, name, None) in (_no_op, None):
if name == 'trace':
def _set_log_level(self, level):
# up to the desired level, we don't do anything, as we're a
# "real" Twisted new-logger; for methods *after* the desired
# level, we bind to the no_op method
desired_index = log_levels.index(level)
for (idx, name) in enumerate(log_levels):
if name == 'none':
continue
if idx > desired_index:
current = getattr(self, name, None)
if not current == _no_op or current is None:
setattr(self, name, _no_op)
if name == 'error':
setattr(self, 'failure', _no_op)
else:
if getattr(self, name, None) in (_no_op, None):
if name == 'trace':