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

handle case when non-ascii char are logged #188

Merged
merged 1 commit into from
Apr 12, 2017
Merged

handle case when non-ascii char are logged #188

merged 1 commit into from
Apr 12, 2017

Conversation

tgermain
Copy link

Fix #187 by encoding response in utf-8 before logging it.

It could also be done for the whole logger but I have no idea how right now.

@solarkennedy
Copy link
Contributor

How about

logging._defaultFormatter = logging.Formatter(u"%(message)s")

in init.py?

@tgermain
Copy link
Author

It's not the log itself but the "{}".format(u'\xe7\xe7') inside the log. We are trying to put a utf-8 string into a non-utf-8 string.

u"{}".format(u'\xe7\xe7') seems to do the job. I don't know with solution is better, thoughts @solarkennedy ?

I tried to change the default formatter, the issue remain.

@solarkennedy
Copy link
Contributor

Oh, I understand now (I think). No I think this patch is ok.

@solarkennedy solarkennedy merged commit d331818 into thefactory:master Apr 12, 2017
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

Successfully merging this pull request may close these issues.

2 participants