Change in vdsm[master]: logging: Don't crash on non-ASCII in SimpleLogAdapter
mzamazal at redhat.com
mzamazal at redhat.com
Wed Nov 18 10:24:24 UTC 2015
Milan Zamazal has posted comments on this change.
Change subject: logging: Don't crash on non-ASCII in SimpleLogAdapter
......................................................................
Patch Set 2:
(1 comment)
https://gerrit.ovirt.org/#/c/48542/2/vdsm/logUtils.py
File vdsm/logUtils.py:
Line 92: def process(self, msg, kwargs):
Line 93: result = ''
Line 94: for key, value in self.extra.iteritems():
Line 95: if isinstance(value, unicode):
Line 96: value = value.encode('utf-8', 'replace')
> Can you show unicode value that cannot be encoded as utf8 and needs the 're
You're right, there seems to be no such value; the unicode->string direction should be safe.
Line 97: result += '%s=`%s`' % (key, value)
Line 98: if isinstance(msg, unicode):
Line 99: msg = msg.encode('utf-8', 'replace')
Line 100: result += '::%s' % msg
--
To view, visit https://gerrit.ovirt.org/48542
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I1930817ade1799b218913348ffa099aab2211ef7
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Milan Zamazal <mzamazal at redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Milan Zamazal <mzamazal at redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Vinzenz Feenstra <vfeenstr at redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>
Gerrit-HasComments: Yes
More information about the vdsm-patches
mailing list