updated loguru
This commit is contained in:
@@ -18,7 +18,6 @@ python crystfel_split.py -l <path-to-list-file>
|
||||
|
||||
# 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 )
|
||||
|
||||
Reference in New Issue
Block a user