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

exception logging raises TypeError #1

Open
TeronKellerus opened this issue Jun 21, 2019 · 1 comment
Open

exception logging raises TypeError #1

TeronKellerus opened this issue Jun 21, 2019 · 1 comment

Comments

@TeronKellerus
Copy link

Hello,
python_log_indenter is awesome, but i found out, that it does not completely mirror logging library.
Calling Logger.exception() while passing something other string raises TypeError since it is concatenated to other string.
The concatenation is in pli.py on line 475.

Example with logging logger and IndentedLoggerAdapter:

from python_log_indenter import IndentedLoggerAdapter
import logging

log1 = logging.getLogger(__name__)
log2 = IndentedLoggerAdapter(logging.getLogger(__name__))


def foo():
    raise Exception("bar")

try:
    foo()
except Exception as e:
    log1.exception(e)
    log2.exception(e)
@dstrohl
Copy link
Owner

dstrohl commented Aug 21, 2019

Thanks for catching this (and sorry for taking a while to get back to you. I'll take a look at it and see if I can address the issue. (it doesn't SOUND like it will be tough to fix... course that statement has gotten me into trouble before.).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants