Skip to content

Commit

Permalink
feature(log): Adds a logging module to the package
Browse files Browse the repository at this point in the history
  • Loading branch information
ns-rse committed Nov 22, 2024
1 parent e12e78d commit 8a5d6af
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
14 changes: 14 additions & 0 deletions isoslam/logging.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
"""Configure logging."""

import sys

from loguru import logger

logger.remove()
logger.add(sys.stderr)
logger.add(
sys.stderr,
colorize=True,
format="{time:HH:mm:ss} | <level>{level}</level> |<magenta>{file}</magenta>:<magenta>{module}</magenta>:"
"<magenta>{function}</magenta>:<magenta>{line}</magenta> | <level>{message}</level>",
)
8 changes: 8 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ dependencies = [
"cgat",
"cgatcore",
"gevent",
"loguru",
"matplotlib",
"numpy",
"pandas",
Expand Down Expand Up @@ -80,6 +81,7 @@ dev = [
"pyupgrade",
"pytest-durations",
"pytest-icdiff",
"pytest-testmon",
"pytest-xdist",
]
pypi = [
Expand Down Expand Up @@ -129,6 +131,7 @@ xfail_strict = true
source = ["isoslam"]
omit = [
"isoslam/_version.py",
"isoslam/all_introns_counts_and_info.py",
"*tests*",
"**/__init__*",
]
Expand Down Expand Up @@ -170,6 +173,7 @@ exclude = [
"build",
"dist",
"docs/source/conf.py",
"isoslam/all_introns_counts_and_info.py",
]
# per-file-ignores = []
line-length = 120
Expand Down Expand Up @@ -251,6 +255,7 @@ exclude = [ # don't report on objects that match any of these regex
"^test_",
"^conftest",
"^conf$",
"isoslam/all_introns_counts_and_info.py",
]
override_SS05 = [ # override SS05 to allow docstrings starting with these words
"^Process ",
Expand All @@ -267,6 +272,9 @@ python_version = "3.9"
strict = true
enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"]
warn_unreachable = true
exclude = [
"isoslam/all_introns_counts_and_info.py",
]

[[tool.mypy.overrides]]
module = [ "numpy.*", ]
Expand Down

0 comments on commit 8a5d6af

Please sign in to comment.