Comment 10 for bug 1225099

Revision history for this message
Luis A. Garcia (luisg-8) wrote :

Sorry we missed you on IRC Mark. We met with dhellman, and bnemec on IRC.

We all agree that the current proposal of basically changing the Message class at a fundamental level so that it is immutable is a no-go for Havana, given the complexity of the fix and risk for regressions.

However given how the issue is limited to logging, there is a different approach that was proposed by dhellman that addresses the specific problem with logging instead of having to drop the whole REST API translations feature.

To recap the problem, inside python logging the Message is converted first to string then to unicode, which breaks if the message contained non-ascii characters. It is converted first to string because that is the default behavior for non-basestring classes which Message is.

dhellman proposes creating a LoggerAdapter, very similar to ContextAdapter, that will unicode() the Message objects so the loggers don't deal with Messages.

We will write, test and send out a patch shortly.