Skip to content

Commit

Permalink
Merge pull request #274 from ligangty/logs
Browse files Browse the repository at this point in the history
Replace space in error log file name of product and version
  • Loading branch information
ligangty authored Sep 23, 2024
2 parents a1fc373 + b9ab2e9 commit 0064e42
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
9 changes: 4 additions & 5 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ confidence=
# --enable=similarities". If you want to run only the classes checker, but have
# no Warning level messages displayed, use"--disable=all --enable=classes
# --disable=W"
enable=all,
python3
enable=all
disable=I,
R, # refactoring checks
abstract-method, # nice to have
Expand All @@ -34,14 +33,14 @@ disable=I,
bad-whitespace, # pep8, nice to have
broad-except,
comprehension-escape, # throws false positives on 1.9.0 (Fedora 29)
deprecated-lambda, # nice to have
; deprecated-lambda, # nice to have
import-outside-toplevel,
import-error, # requires to having all modules installed
invalid-name,
len-as-condition, # nice to have
line-too-long, # pep8, should be enabled
missing-docstring,
misplaced-comparison-constant,
; misplaced-comparison-constant,
multiple-statements, # nice to have
no-absolute-import, # it was required for py2
no-init,
Expand All @@ -51,7 +50,7 @@ disable=I,
old-division, # it was required for py2
protected-access,
redefined-outer-name, # nice to have
relative-import, # nice to have
; relative-import, # nice to have
super-init-not-called, # nice to have
superfluous-parens, # nice to have
too-many-lines,
Expand Down
4 changes: 3 additions & 1 deletion charon/utils/logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,10 @@ def set_logging(


def set_log_file_handler(product: str, version: str, logger: logging):
prd = product.replace(" ", "_")
ver = version.replace(" ", "_")
log_loc = os.getenv("ERROR_LOG_LOCATION")
error_log = "".join([product, "-", version, ".", DEFAULT_ERRORS_LOG])
error_log = "".join([prd, "-", ver, ".", DEFAULT_ERRORS_LOG])
if log_loc:
os.makedirs(log_loc, exist_ok=True)
error_log = os.path.join(log_loc, error_log)
Expand Down

0 comments on commit 0064e42

Please sign in to comment.