updated loguru
This commit is contained in:
@@ -18,7 +18,6 @@ python crystfel_split.py -l <path-to-list-file>
|
|||||||
|
|
||||||
# output
|
# output
|
||||||
a series of stream files from crystfel in the current working directory
|
a series of stream files from crystfel in the current working directory
|
||||||
a log file with relavent info on the run
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# modules
|
# modules
|
||||||
@@ -349,12 +348,21 @@ if __name__ == "__main__":
|
|||||||
type=str,
|
type=str,
|
||||||
default="split"
|
default="split"
|
||||||
)
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
"-d",
|
||||||
|
"--debug",
|
||||||
|
help="output debug to terminal",
|
||||||
|
type=bool,
|
||||||
|
default=False
|
||||||
|
)
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
# set current working directory
|
# set current working directory
|
||||||
cwd = os.getcwd()
|
cwd = os.getcwd()
|
||||||
# set loguru
|
# set loguru
|
||||||
|
if not args.debug:
|
||||||
|
logger.remove()
|
||||||
logfile = "{0}.log".format( args.job_name )
|
logfile = "{0}.log".format( args.job_name )
|
||||||
logger.add( logfile, level="DEBUG" )
|
logger.add( logfile, format="{message}", level="INFO")
|
||||||
# log geometry file
|
# log geometry file
|
||||||
geom = open( args.geom_file, "r" ).read()
|
geom = open( args.geom_file, "r" ).read()
|
||||||
logger.info( geom )
|
logger.info( geom )
|
||||||
|
|||||||
Reference in New Issue
Block a user