Resolve #16: Verbosity config should be levels not binary
Resolves: #16
This commit is contained in:
parent
f46f99c1a2
commit
7496d5505e
|
@ -20,7 +20,7 @@ The following environment variables will override any config or default:
|
||||||
* GOTIFY_PORT (default: 80)
|
* GOTIFY_PORT (default: 80)
|
||||||
* GOTIFY_SERVER (default: localhost)
|
* GOTIFY_SERVER (default: localhost)
|
||||||
* LISTEN_PORT (default: 8080)
|
* LISTEN_PORT (default: 8080)
|
||||||
* VERBOSE (default: False)
|
* VERBOSE (default: 0)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -59,9 +59,14 @@ if __name__ == '__main__':
|
||||||
# forwarder = alertify.Alertify(args.config)
|
# forwarder = alertify.Alertify(args.config)
|
||||||
forwarder = alertify.Alertify()
|
forwarder = alertify.Alertify()
|
||||||
|
|
||||||
if forwarder.config.verbose:
|
#-----------------------------
|
||||||
|
# Calculate logging level
|
||||||
|
#-----------------------------
|
||||||
|
# Config :: Verbose: 0 = WARNING, 1 = INFO, 2 = DEBUG
|
||||||
|
# Logging :: Loglevel: 30 = WARNING, 20 = INFO, 10 = DEBUG
|
||||||
logger = logging.getLogger()
|
logger = logging.getLogger()
|
||||||
logger.setLevel(logging.DEBUG)
|
logger.setLevel(30 - (forwarder.config.verbose * 10))
|
||||||
|
#-----------------------------
|
||||||
|
|
||||||
if args.healthcheck:
|
if args.healthcheck:
|
||||||
# Invert the sense of 'healthy' for Unix CLI usage
|
# Invert the sense of 'healthy' for Unix CLI usage
|
||||||
|
|
|
@ -21,7 +21,7 @@ class Config:
|
||||||
gotify_port = int(80)
|
gotify_port = int(80)
|
||||||
gotify_server = str('localhost')
|
gotify_server = str('localhost')
|
||||||
listen_port = int(8080)
|
listen_port = int(8080)
|
||||||
verbose = bool(False)
|
verbose = int(0)
|
||||||
|
|
||||||
def __init__(self, configfile=None):
|
def __init__(self, configfile=None):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in a new issue