Skip to content

Commit

Permalink
fix: simplify logger in dataplugin_localhub
Browse files Browse the repository at this point in the history
  • Loading branch information
newgene committed May 11, 2023
1 parent 60747d4 commit 87584ed
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion biothings/management/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ def setup_config():
setattr(_config, attr, value)
except ModuleNotFoundError:
logger.debug("The config.py does not exists in the working directory, use default biothings.config")
pass

sys.modules["config"] = _config
sys.modules["biothings.config"] = _config
Expand Down
4 changes: 2 additions & 2 deletions biothings/management/dataplugin_localhub.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

from biothings.management import utils

logger = utils.get_logger("dataplugin-hub")

short_help = "[green]Test multiple data plugins in a local minimal hub without any external databases.[/green]"
long_help = (
short_help
Expand Down Expand Up @@ -228,7 +230,6 @@ def inspect(
rprint("[red]Please provide your data plugin name! [/red]")
rprint("Choose from:\n " + "\n ".join(valid_names))
return exit(1)
logger = utils.get_logger("inspect")
if not limit:
limit = None
logger.info(f"Inspect Data plugin {plugin_name} with sub-source name: {sub_source_name} mode: {mode} limit {limit}")
Expand Down Expand Up @@ -275,7 +276,6 @@ def clean_data(
help="Delete all dumped files and drop uploaded sources tables",
),
):
logger = utils.get_logger("clean")
working_dir = pathlib.Path().resolve()
valid_names = [f.name for f in os.scandir(working_dir) if f.is_dir() and not f.name.startswith(".")]
if not plugin_name or plugin_name not in valid_names:
Expand Down
2 changes: 1 addition & 1 deletion biothings/management/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def get_logger(name):
datefmt="[%X]",
handlers=[RichHandler(rich_tracebacks=True, show_path=False)],
)
logger = logging.getLogger("cli")
logger = logging.getLogger(name)
return logger


Expand Down

0 comments on commit 87584ed

Please sign in to comment.