Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove multiline logger #8781

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ associations

- Update warning message about use of paths in associations. [#8752]

- Remove ``MultilineLogger`` and no longer set it as the default logger. [#8781]

badpix_selfcal
--------------

Expand Down
24 changes: 0 additions & 24 deletions jwst/associations/lib/log_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
from logging.config import dictConfig
from collections import defaultdict

from functools import partialmethod


__all__ = ['log_config']

Expand Down Expand Up @@ -147,28 +145,6 @@ def format(self, record):
}


class MultilineLogger(logging.getLoggerClass()):
"""Split multilines so that each line is logged separately"""

def __init__(self, *args, **kwargs):
super(MultilineLogger, self).__init__(*args, **kwargs)

def log(self, level, msg, *args, **kwargs):
if self.isEnabledFor(level):
for line in msg.split('\n'):
self._log(level, line, args, **kwargs)

debug = partialmethod(log, logging.DEBUG)
info = partialmethod(log, logging.INFO)
warning = partialmethod(log, logging.WARNING)
error = partialmethod(log, logging.ERROR)
critical = partialmethod(log, logging.CRITICAL)
fatal = critical


logging.setLoggerClass(MultilineLogger)


def log_config(name=None,
user_name=None,
logger_config=None,
Expand Down
Loading