Add --silent option to disable logging to terminal
This commit is contained in:
parent
0d6d19502f
commit
66e2192e65
3 changed files with 7 additions and 2 deletions
|
@ -168,6 +168,7 @@ class Config(object):
|
|||
# Config parameters
|
||||
self.parser.add_argument('--verbose', help='More detailed logging', action='store_true')
|
||||
self.parser.add_argument('--debug', help='Debug mode', action='store_true')
|
||||
self.parser.add_argument('--silent', help='Disable logging to terminal output', action='store_true')
|
||||
self.parser.add_argument('--debug_socket', help='Debug socket connections', action='store_true')
|
||||
self.parser.add_argument('--debug_gevent', help='Debug gevent functions', action='store_true')
|
||||
|
||||
|
|
|
@ -76,9 +76,13 @@ if config.action == "main":
|
|||
)
|
||||
else:
|
||||
log_file_path = "%s/cmd.log" % config.log_dir
|
||||
if config.silent:
|
||||
level = logging.ERROR
|
||||
else:
|
||||
level = logging.DEBUG
|
||||
logging.basicConfig(
|
||||
format='[%(asctime)s] %(levelname)-8s %(name)s %(message)s',
|
||||
level=logging.DEBUG, stream=open(log_file_path, "w")
|
||||
level=level, stream=open(log_file_path, "w")
|
||||
)
|
||||
|
||||
# Console logger
|
||||
|
|
Loading…
Reference in a new issue