mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-19 21:03:14 -07:00
Fix flake8-bugbear B010 Do not call setattr with a constant attribute value, it is not any safer than normal property access.
This commit is contained in:
parent
267d8d1632
commit
e00b5cc195
1 changed files with 3 additions and 3 deletions
|
@ -6,6 +6,7 @@ import sys
|
||||||
import threading
|
import threading
|
||||||
|
|
||||||
import core
|
import core
|
||||||
|
import functools
|
||||||
|
|
||||||
# number of log files to keep
|
# number of log files to keep
|
||||||
NUM_LOGS = 3
|
NUM_LOGS = 3
|
||||||
|
@ -199,9 +200,8 @@ class NTMRotatingLogHandler(object):
|
||||||
ntm_logger = logging.getLogger('nzbtomedia')
|
ntm_logger = logging.getLogger('nzbtomedia')
|
||||||
pp_logger = logging.getLogger('postprocess')
|
pp_logger = logging.getLogger('postprocess')
|
||||||
db_logger = logging.getLogger('db')
|
db_logger = logging.getLogger('db')
|
||||||
setattr(pp_logger, 'postprocess', lambda *args: pp_logger.log(POSTPROCESS, *args))
|
pp_logger.postprocess = functools.partial(pp_logger.log, POSTPROCESS)
|
||||||
setattr(db_logger, 'db', lambda *args: db_logger.log(DB, *args))
|
db_logger.db = functools.partial(db_logger.log, DB)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if log_level == DEBUG:
|
if log_level == DEBUG:
|
||||||
if core.LOG_DEBUG == 1:
|
if core.LOG_DEBUG == 1:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue