Skip to content

Commit

Permalink
redefine
Browse files Browse the repository at this point in the history
  • Loading branch information
marcin-usielski committed Feb 6, 2024
1 parent b0838d8 commit 0872b8d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
1 change: 1 addition & 0 deletions moler/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@


@add_metaclass(ABCMeta)
# pylint: disable=W0223
class Command(ConnectionObserver):
def __init__(self, connection: Optional[AbstractMolerConnection] = None, runner: Optional[ConnectionObserverRunner] = None):
"""
Expand Down
18 changes: 9 additions & 9 deletions moler/config/loggers.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,9 @@ def get_logging_path():
return _logging_path


def set_date_format(format):
def set_date_format(format_):
global date_format # pylint: disable=global-statement
date_format = format
date_format = format_


def configure_debug_level(level=None):
Expand Down Expand Up @@ -376,15 +376,15 @@ def debug_level_or_info_level():


def setup_new_file_handler(
logger_name, log_level, log_filename, formatter, filter=None
logger_name, log_level, log_filename, formatter, log_filter=None
):
"""
Sets up new file handler for given logger
:param logger_name: name of logger to which filelogger is added
:param log_level: logging level
:param log_filename: path to log file
:param formatter: formatter for file logger
:param filter: filter for file logger
:param log_filter: filter for file logger
:return: logging.FileHandler object
"""
global write_mode # pylint: disable=global-statement, global-variable-not-assigned
Expand Down Expand Up @@ -433,22 +433,22 @@ def setup_new_file_handler(
)
cfh.setLevel(log_level)
cfh.setFormatter(formatter)
if filter:
cfh.addFilter(filter)
if log_filter:
cfh.addFilter(log_filter)
logger.addHandler(cfh)
return cfh


def _add_new_file_handler(
logger_name, log_file, formatter, log_level=TRACE, filter=None
logger_name, log_file, formatter, log_level=TRACE, log_filter=None
):
"""
Add file writer into Logger
:param logger_name: Logger name
:param log_file: Path to logfile. Final logfile location is logging_path + log_file
:param log_level: only log records with equal and greater level will be accepted for storage in log
:param formatter: formatter for file logger
:param filter: filter for file logger
:param log_filter: filter for file logger
:return: None
"""

Expand All @@ -460,7 +460,7 @@ def _add_new_file_handler(
log_level=log_level,
log_filename=logfile_full_path,
formatter=formatter,
filter=filter,
log_filter=log_filter,
)


Expand Down

0 comments on commit 0872b8d

Please sign in to comment.