include current Git HEAD in debug output
This commit is contained in:
parent
c9f70e0a19
commit
39f609b4c6
@ -238,8 +238,24 @@ def main():
|
|||||||
config.set(("output", "mode"), "null")
|
config.set(("output", "mode"), "null")
|
||||||
elif args.loglevel <= logging.DEBUG:
|
elif args.loglevel <= logging.DEBUG:
|
||||||
import platform
|
import platform
|
||||||
|
import subprocess
|
||||||
|
import os.path
|
||||||
import requests
|
import requests
|
||||||
log.debug("Version %s", __version__)
|
|
||||||
|
head = ""
|
||||||
|
try:
|
||||||
|
out, err = subprocess.Popen(
|
||||||
|
("git", "rev-parse", "--short", "HEAD"),
|
||||||
|
stdout=subprocess.PIPE,
|
||||||
|
stderr=subprocess.PIPE,
|
||||||
|
cwd=os.path.dirname(os.path.abspath(__file__)),
|
||||||
|
).communicate()
|
||||||
|
if out and not err:
|
||||||
|
head = " - Git HEAD: " + out.decode().rstrip()
|
||||||
|
except (OSError, subprocess.SubprocessError):
|
||||||
|
pass
|
||||||
|
|
||||||
|
log.debug("Version %s%s", __version__, head)
|
||||||
log.debug("Python %s - %s",
|
log.debug("Python %s - %s",
|
||||||
platform.python_version(), platform.platform())
|
platform.python_version(), platform.platform())
|
||||||
try:
|
try:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user