aboutsummaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorAaron LI <aaronly.me@outlook.com>2016-11-04 13:59:20 +0800
committerAaron LI <aaronly.me@outlook.com>2016-11-04 13:59:20 +0800
commit32efcaff8b0de30b7f3abb56dd195695530bcbfe (patch)
tree228ebdb9613fe43bb144cc05001cf9f98856891e /bin
parent54b756d88b72eb07f4ee9fbb6b5f9d35ae1484a3 (diff)
downloadfg21sim-32efcaff8b0de30b7f3abb56dd195695530bcbfe.tar.bz2
bin: Update "log_stream" and "loglevel" handling
* bin/fg21sim: Simplify the "log_stream" assignment * bin/fg21sim-webui: Also enable debug logging when turning on debug flag for the tornado; also update the docstring a little.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/fg21sim6
-rwxr-xr-xbin/fg21sim-webui7
2 files changed, 5 insertions, 8 deletions
diff --git a/bin/fg21sim b/bin/fg21sim
index 42bdcca..e605c97 100755
--- a/bin/fg21sim
+++ b/bin/fg21sim
@@ -38,11 +38,7 @@ def main():
sep="\n", file=sys.stderr)
check_configs(configs)
- if args.quiet:
- log_stream = ""
- else:
- log_stream = None
-
+ log_stream = "" if args.quiet else None
setup_logging(dict_config=configs.logging,
level=args.loglevel,
stream=log_stream,
diff --git a/bin/fg21sim-webui b/bin/fg21sim-webui
index 225aeed..8fc7673 100755
--- a/bin/fg21sim-webui
+++ b/bin/fg21sim-webui
@@ -5,8 +5,8 @@
# MIT license
"""
-Start (and control) the Web user interface (UI) of "fg21sim",
-which is based upon Tornado_ and uses WebSocket_.
+Start (and/or control) the Web user interface (UI) of "fg21sim",
+which is built using the Tornado_ web server and WebSocket_ protocol.
.. _Tornado: http://www.tornadoweb.org/
@@ -35,7 +35,8 @@ def main():
help="enable Tornado debug mode")
args = parser.parse_args()
- setup_logging(dict_config=configs.logging)
+ loglevel = "DEBUG" if args.debug else None
+ setup_logging(dict_config=configs.logging, level=loglevel)
tool = os.path.basename(sys.argv[0])
logger = logging.getLogger(tool)
logger.info("COMMAND: {0}".format(" ".join(sys.argv)))