Skip to content

Commit

Permalink
Tweak logging for utility scripts
Browse files Browse the repository at this point in the history
urwid seems to have changed the way logging works; lock at 2.1 of urwid
and tweak logging for elk scripts.
  • Loading branch information
gwww committed Jun 11, 2024
1 parent 0513d30 commit 5bd4c02
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 58 deletions.
10 changes: 8 additions & 2 deletions bin/elk
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,19 @@ def main():
if args.interactive:
c = cmdr.Commander("Elk console", cmd_cb=cmdr.Commands(elk))
mystdout = StdOutWrapper(c)
logging.basicConfig(stream=mystdout, level=logging.DEBUG, format="%(message)s")
logging.basicConfig(stream=mystdout, format="%(message)s")
LOG.setLevel(logging.DEBUG)
logging.getLogger("elkm1_lib").setLevel(logging.DEBUG)
try:
c.loop()
except KeyboardInterrupt:
exit(0)
else:
logging.basicConfig(level=logging.DEBUG, format="%(asctime)s.%(msecs)03d %(message)s", datefmt='%H:%M:%S')
logging.basicConfig(
format="%(asctime)s.%(msecs)03d %(message)s", datefmt="%H:%M:%S"
)
LOG.setLevel(logging.DEBUG)
logging.getLogger("elkm1_lib").setLevel(logging.DEBUG)
try:
elk.run()
except KeyboardInterrupt:
Expand Down
84 changes: 29 additions & 55 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ colorlog = ">= 4.0"
isort = ">= 5.10"
mypy = ">= 0.9"
pylint = ">= 2"
urwid = ">= 2.0"
urwid = "~ 2.1"

[tool.poetry.group.test.dependencies]
pytest = ">= 7.2"
Expand Down

0 comments on commit 5bd4c02

Please sign in to comment.