Skip to content

Commit

Permalink
feat: add rich logging format string
Browse files Browse the repository at this point in the history
  • Loading branch information
kentbull committed Jan 30, 2025
1 parent 9d6c44f commit 7e04c42
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/keri/app/cli/commands/witness/demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
parser = argparse.ArgumentParser(description="Run a demo collection of witnesses")
parser.set_defaults(handler=lambda args: demo(args))

help.ogler.level = logging.INFO
logger = help.ogler.getLogger()

def demo(_):
"""
Expand Down
11 changes: 11 additions & 0 deletions src/keri/help/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,16 @@ def trace(self, message, *args, **kwargs):
# want help.ogler always defined by default
ogler = ogling.initOgler(prefix='keri', syslogged=False) # inits once only on first import

# set log formatters with detailed log output
logFmt = "%(asctime)s [keri] %(module)s.%(funcName)s-%(lineno)d %(levelname)-8s %(message)s"
formatter = logging.Formatter(logFmt)

ch = logging.StreamHandler()
ch.setFormatter(formatter)
ogler.baseConsoleHandler = ch
ogler.baseFormatter = formatter

ogler.reopen(headDirPath=ogler.headDirPath)

from .helping import (nowIso8601, toIso8601, fromIso8601,
nonStringSequence, nonStringIterable, Reb64)

0 comments on commit 7e04c42

Please sign in to comment.