From 6a165e060a6fbc0b026694aea8e1fbb5df27f17f Mon Sep 17 00:00:00 2001 From: s-a-tanjim Date: Mon, 19 Feb 2024 13:52:07 +0600 Subject: [PATCH] Make log level configurable from command line argument --- src/keri/app/cli/commands/witness/start.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/keri/app/cli/commands/witness/start.py b/src/keri/app/cli/commands/witness/start.py index cba96b410..7fff2cd94 100644 --- a/src/keri/app/cli/commands/witness/start.py +++ b/src/keri/app/cli/commands/witness/start.py @@ -47,10 +47,11 @@ parser.add_argument("--keypath", action="store", required=False, default=None) parser.add_argument("--certpath", action="store", required=False, default=None) parser.add_argument("--cafilepath", action="store", required=False, default=None) +parser.add_argument("--loglevel", action="store", required=False, default="CRITICAL", help="Set log level to DEBUG | INFO | WARNING | ERROR | CRITICAL. Default is CRITICAL") def launch(args): - help.ogler.level = logging.INFO + help.ogler.level = logging.getLevelName(args.loglevel) help.ogler.reopen(name=args.name, temp=True, clear=True) # need to configure for logging persistent file logger = help.ogler.getLogger()