Skip to content

Commit

Permalink
Writing logs into file is configurable from cli argument (WebOfTrust#223
Browse files Browse the repository at this point in the history
)
  • Loading branch information
s-a-tanjim authored Apr 4, 2024
1 parent 664cfee commit 0d4f8a7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/keria/app/cli/commands/start.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,15 @@
help="TLS server CA certificate chain")
parser.add_argument("--loglevel", action="store", required=False, default="CRITICAL",
help="Set log level to DEBUG | INFO | WARNING | ERROR | CRITICAL. Default is CRITICAL")
parser.add_argument("--logfile", action="store", required=False, default=None,
help="path of the log file. If not defined, logs will not be written to the file.")


def launch(args):
help.ogler.level = logging.getLevelName(args.loglevel)
help.ogler.reopen(name=args.name, temp=True, clear=True)
if(args.logfile != None):
help.ogler.headDirPath = args.logfile
help.ogler.reopen(name=args.name, temp=False, clear=True)

logger = help.ogler.getLogger()

Expand Down

0 comments on commit 0d4f8a7

Please sign in to comment.