Skip to content

Commit

Permalink
Add stderr logger early in main
Browse files Browse the repository at this point in the history
Because we remove the default logger on init, but only add the new logger when
run() is called, there is no logger available during the preprocessing steps,
e.g. argparsing.
This leads to warnings not being shown to the user, which is very bad from a
usability point of view.
  • Loading branch information
jakobnissen committed Apr 22, 2024
1 parent 8a9d061 commit 67e9b70
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion vamb/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1398,7 +1398,6 @@ def run(self):
logger.add(
self.vamb_options.out_dir.joinpath(self.LOGS_PATH), format=format_log
)
logger.add(sys.stderr, format=format_log)
begintime = time.time()
logger.info("Starting Vamb version " + vamb.__version_str__)
logger.info("Random seed is " + str(self.vamb_options.seed))
Expand Down Expand Up @@ -2064,6 +2063,8 @@ def main():
vamb bin default --outdir out --fasta my_contigs.fna --bamfiles *.bam -o C
Find the latest updates and documentation at https://github.com/RasmussenLab/vamb"""
logger.add(sys.stderr, format=format_log)

parser = argparse.ArgumentParser(
prog="vamb",
description=doc,
Expand Down

0 comments on commit 67e9b70

Please sign in to comment.