cancervariants / metakb

Central repository for the VICC metakb web application
MIT License
14 stars 4 forks source link

log file has wrong name #369

Open korikuzma opened 1 week ago

korikuzma commented 1 week ago

Describe the bug

Log file being created has the wrong name

Steps to reproduce

  1. Run python3 -m metakb.cli update -r inside virtual env

  2. In a separate terminal (at the root dir)

    $ ls | grep .log
    gene.log

Expected behavior

Log file should be named metakb.log

Current behavior

Log file is named gene.log

Possible reason(s)

Gene Normalizer logging config is overriding MetaKB's logging config. We have to configure MetaKB logging before importing any modules that define their own logging config.

Suggested fix

Having this is the top of the CLI module creates a log file with the expected name:

from metakb.log_handle import configure_logs
configure_logs()

Not really the best solution because it causes several ruff errors: Module level import not at top of file.

Branch, commit, and/or version

branch: staging commit: 7301382

Screenshots

No response

Environment details

No response

Additional details

I think that @jsstevenson was working on resolving logging configs in our apps, so this may not be an issue once new releases are made.

jsstevenson commented 1 week ago

I think that @jsstevenson was working on resolving logging configs in our apps, so this may not be an issue once new releases are made.

Yeah, this is fixed in a development branch of the gene normalizer but unfortunately not on the main branch. I can/should probably just make a quick fix.

jsstevenson commented 6 hours ago

should be fixed by https://github.com/cancervariants/gene-normalization/pull/351