7 def git_hash(short=False):
9 return subprocess.check_output(['git', 'rev-parse', '--short', 'HEAD']).decode().strip()
11 subprocess.check_output(['git', 'rev-parse', 'HEAD']).decode().strip()
13 def get_loglevel(arg_loglevel):
14 loglevel_mapping = { 'debug' : logging.DEBUG,
15 'info' : logging.INFO,
16 'warning' : logging.WARNING,
17 'error' : logging.ERROR,
18 'critical' : logging.CRITICAL }
20 if arg_loglevel in loglevel_mapping:
21 loglevel = loglevel_mapping[arg_loglevel]
24 print("Choose a valid log level: debug, info, warning, error, or critical", file=sys.stderr)