Browse Source

enable lss debug environment in verbose mode

master
Nils 2 years ago
parent
commit
ef7db72a7d
  1. 10
      engine/start.py

10
engine/start.py

@ -44,7 +44,7 @@ import os.path
import argparse
parser = argparse.ArgumentParser(description=f"""{METADATA["name"]} - Version {METADATA["version"]} - Copyright {METADATA["year"]} by {METADATA["author"]} - {METADATA["url"]}""")
parser.add_argument("-v", "--version", action='version', version="{} {}".format(METADATA["name"], METADATA["version"]))
parser.add_argument("-V", "--verbose", action='store_true', help="(Development) Switch the logger to INFO and give out all kinds of information to get a high-level idea of what the program is doing.")
parser.add_argument("-V", "--verbose", action='store_true', help="(Development) Switch the logger to INFO and print out all kinds of information to get a high-level idea of what the program is doing. You can also set the environment variable LSS_DEBUG=1")
parser.add_argument("-u", "--url", action='store', dest="url", help="Force URL for the session. If there is already a running session we will connect to it. Otherwise we will start one there. Default is local host with random port. Example: osc.udp://myhost.localdomain:14294/")
parser.add_argument("--nsm-url", action='store', dest="url", help="Same as --url.")
@ -56,6 +56,14 @@ parser.add_argument("--session-root", action='store', dest="sessionRoot", help="
args = parser.parse_args()
#Check for an alternative way to enable the logger.
import os
if args.verbose:
os.environ["LSS_DEBUG"] = 1 #for children programs.
elif not args.verbose and os.getenv("LSS_DEBUG"):
args.verbose = True
import logging
if args.verbose: #development
logging.basicConfig(level=logging.INFO, format='[' + METADATA["shortName"] + '] %(levelname)s %(asctime)s %(name)s: %(message)s',)

Loading…
Cancel
Save