From ee52220e8527142bb8a479e5739ee175ce3437cd Mon Sep 17 00:00:00 2001 From: Beale John Henry Date: Wed, 27 Sep 2023 15:42:54 +0200 Subject: [PATCH] updated loguru --- reduction_tools/crystfel_split.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/reduction_tools/crystfel_split.py b/reduction_tools/crystfel_split.py index 01d62c5..746446f 100644 --- a/reduction_tools/crystfel_split.py +++ b/reduction_tools/crystfel_split.py @@ -18,7 +18,6 @@ python crystfel_split.py -l # output a series of stream files from crystfel in the current working directory -a log file with relavent info on the run """ # modules @@ -349,12 +348,21 @@ if __name__ == "__main__": type=str, default="split" ) + parser.add_argument( + "-d", + "--debug", + help="output debug to terminal", + type=bool, + default=False + ) args = parser.parse_args() # set current working directory cwd = os.getcwd() # set loguru + if not args.debug: + logger.remove() logfile = "{0}.log".format( args.job_name ) - logger.add( logfile, level="DEBUG" ) + logger.add( logfile, format="{message}", level="INFO") # log geometry file geom = open( args.geom_file, "r" ).read() logger.info( geom )