[core] Disable debugging if "-d" is not specified
Do not print any debugging messages unless "-d" has been specified on the commandline. Also, introduce two "special" logfiles "stdout" and "stderr" to log to stdout and stderr, respectively. fixes #213
This commit is contained in:
parent
63ef6b0bf8
commit
10df79ce9a
1 changed files with 12 additions and 11 deletions
|
@ -21,16 +21,17 @@ def main():
|
||||||
config = bumblebee.config.Config(sys.argv[1:])
|
config = bumblebee.config.Config(sys.argv[1:])
|
||||||
|
|
||||||
if config.debug():
|
if config.debug():
|
||||||
|
if config.logfile() in ["stdout", "stderr"]:
|
||||||
logging.basicConfig(
|
logging.basicConfig(
|
||||||
level=logging.DEBUG,
|
level=logging.DEBUG,
|
||||||
format="[%(asctime)s] %(levelname)-8s %(message)s",
|
format="[%(asctime)s] %(levelname)-8s %(message)s",
|
||||||
filename=config.logfile()
|
stream=sys.stdout if config.logfile() == "stdout" else sys.stderr
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
logging.basicConfig(
|
logging.basicConfig(
|
||||||
level=logging.DEBUG,
|
level=logging.DEBUG,
|
||||||
format="[%(asctime)s] %(levelname)-8s %(message)s",
|
format="[%(asctime)s] %(levelname)-8s %(message)s",
|
||||||
stream=sys.stderr
|
filename=config.logfile()
|
||||||
)
|
)
|
||||||
|
|
||||||
theme = bumblebee.theme.Theme(config.theme())
|
theme = bumblebee.theme.Theme(config.theme())
|
||||||
|
|
Loading…
Reference in a new issue