Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 0 additions & 51 deletions bedboss/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
"""Package-level data"""

import logging
from importlib.metadata import version

import coloredlogs

__version__ = version(__package__)
__package_name__ = "bedboss"

Expand All @@ -23,51 +20,3 @@
"__package_name__",
"__author__",
]

_LOGGER = logging.getLogger("bedboss")
_LOGGER.propagate = False
coloredlogs.install(
logger=_LOGGER,
datefmt="%H:%M:%S",
fmt="[%(levelname)s] [%(asctime)s] [BEDBOSS] %(message)s",
)

_LOGGER_PIPESTAT = logging.getLogger("pipestat")
_LOGGER_PIPESTAT.propagate = False
coloredlogs.install(
logger=_LOGGER_PIPESTAT,
datefmt="%H:%M:%S",
fmt="[%(levelname)s] [%(asctime)s] [PIPESTAT] %(message)s",
)

_LOGGER_GENIML = logging.getLogger("geniml")
_LOGGER_GENIML.propagate = False
coloredlogs.install(
logger=_LOGGER_GENIML,
datefmt="%H:%M:%S",
fmt="[%(levelname)s] [%(asctime)s] [GENIML] %(message)s",
)

_LOGGER_BBCONF = logging.getLogger("bbconf")
_LOGGER_BBCONF.propagate = False
coloredlogs.install(
logger=_LOGGER_BBCONF,
datefmt="%H:%M:%S",
fmt="[%(levelname)s] [%(asctime)s] [BBCONF] %(message)s",
)

_LOGGER_PHC = logging.getLogger("pephubclient")
_LOGGER_PHC.propagate = False
coloredlogs.install(
logger=_LOGGER_PHC,
datefmt="%H:%M:%S",
fmt="[%(levelname)s] [%(asctime)s] [PEPHUBCLIENT] %(message)s",
)

_LOGGER_REF_CONF = logging.getLogger("refgenconf")
_LOGGER_REF_CONF.propagate = False
coloredlogs.install(
logger=_LOGGER_PHC,
datefmt="%H:%M:%S",
fmt="[%(levelname)s] [%(asctime)s] [REFGENCONF] %(message)s",
)
12 changes: 0 additions & 12 deletions bedboss/bbuploader/__init__.py
Original file line number Diff line number Diff line change
@@ -1,13 +1 @@
"""Package-level data"""

import coloredlogs
import logmuse

from bedboss.bbuploader.constants import PKG_NAME

_LOGGER = logmuse.init_logger(PKG_NAME)
coloredlogs.install(
logger=_LOGGER,
datefmt="%H:%M:%S",
fmt="[%(levelname)s] [%(asctime)s] [BBUPLOADER] %(message)s",
)
17 changes: 16 additions & 1 deletion bedboss/cli.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os
from importlib.metadata import version as _pkg_version

import logmuse
import typer

__version__ = _pkg_version("bedboss")
Expand Down Expand Up @@ -900,8 +901,22 @@ def common(
version: bool = typer.Option(
None, "--version", "-v", callback=version_callback, help="App version"
),
verbosity: int = typer.Option(
None, "--verbosity", help="Set logging level: 1 (CRITICAL) to 5 (DEBUG)"
),
logdev: bool = typer.Option(False, "--logdev", help="Use developer logging format"),
silent: bool = typer.Option(False, "--silent", help="Silence logging"),
):
pass
# This callback runs before any command, so it is where logging gets
# configured. Don't move this into `__init__.py`.
#
# Configure the root logger so that bedboss and its dependencies (pipestat,
# geniml, bbconf, pephubclient, refgenconf, bbuploader) all log through one
# handler. Each line is tagged with its logger name, so there is no need to
# attach a per-package handler to identify the source.
logmuse.init_logger(
"", make_root=True, verbosity=verbosity, devmode=logdev, silent=silent
)


app.add_typer(app_bbuploader, name="geo")
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ classifiers = [
"Topic :: Scientific/Engineering :: Bio-Informatics",
]
dependencies = [
"logmuse>=0.2.7",
"logmuse>=0.3.1",
"coloredlogs>=15.0.1",
"eido>=0.2.5",
"peppy>=0.40.7",
Expand Down