Skip to content

Commit

Permalink
Merge pull request #1023 from ix5/log-format-default
Browse files Browse the repository at this point in the history
Change logging to include datetime and loglevel
  • Loading branch information
ix5 authored May 4, 2024
2 parents 0b7e6fe + 16620ea commit 6c6d5d2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ Bugfixes & Improvements
- Fix total comments count calculation (`#997`_, pkvach)
- Fix newline character handling in data-isso-* i18n strings (`#992`_, pkvach)
- Add link logging for management of new comments in Stdout (`#1016`_, pkvach)
- Change logging to include datetime and loglevel (`#1023`_, ix5)

.. _#951: https://github.com/posativ/isso/pull/951
.. _#967: https://github.com/posativ/isso/pull/967
Expand All @@ -54,6 +55,7 @@ Bugfixes & Improvements
.. _#997: https://github.com/isso-comments/isso/pull/997
.. _#992: https://github.com/isso-comments/isso/pull/992
.. _#1016: https://github.com/isso-comments/isso/pull/1016
.. _#1023: https://github.com/isso-comments/isso/pull/1023

0.13.1.dev0 (2023-02-05)
------------------------
Expand Down
4 changes: 3 additions & 1 deletion isso/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,11 @@

from isso.ext.notifications import Stdout, SMTP

LOG_FORMAT = "%(asctime)s:%(levelname)s: %(message)s"
logging.getLogger('werkzeug').setLevel(logging.WARN)
logging.basicConfig(
level=logging.INFO,
format="%(asctime)s %(levelname)s: %(message)s")
format=LOG_FORMAT)

logger = logging.getLogger("isso")

Expand Down Expand Up @@ -280,6 +281,7 @@ def main():

if conf.get("general", "log-file"):
handler = logging.FileHandler(conf.get("general", "log-file"))
handler.setFormatter(logging.Formatter(LOG_FORMAT))

logger.addHandler(handler)
logging.getLogger("werkzeug").addHandler(handler)
Expand Down

0 comments on commit 6c6d5d2

Please sign in to comment.