let's see if we can override the loglevel this way
This commit is contained in:
parent
afc4fc2d00
commit
ae729990ca
@ -18,6 +18,7 @@ import argparse
|
|||||||
import logging
|
import logging
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
logging.basicConfig(level=logging.DEBUG, format="%(asctime)s - %(name)s - %(levelname)s - %(message)s")
|
||||||
|
|
||||||
|
|
||||||
class ThreadedHttpServer(ThreadingMixIn, HTTPServer):
|
class ThreadedHttpServer(ThreadingMixIn, HTTPServer):
|
||||||
@ -49,12 +50,9 @@ def main():
|
|||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
loglevel = logging.INFO
|
# set loglevel to info for CLI commands
|
||||||
# set loglevel to debug when running the receiver
|
if args.module is not None and not args.debug:
|
||||||
if args.module is None or args.debug:
|
logging.getLogger().setLevel(logging.INFO)
|
||||||
loglevel = logging.DEBUG
|
|
||||||
|
|
||||||
logging.basicConfig(level=loglevel, format="%(asctime)s - %(name)s - %(levelname)s - %(message)s")
|
|
||||||
|
|
||||||
if args.version:
|
if args.version:
|
||||||
print("OpenWebRX version {version}".format(version=openwebrx_version))
|
print("OpenWebRX version {version}".format(version=openwebrx_version))
|
||||||
|
Loading…
Reference in New Issue
Block a user