bmuller/twistar — pull request #21 by flaviogrossi (2011-11-29 15:13:45+00:00)
Title: error when logging queries with non-ascii values (with debug on)

hi,

i get an error in debug mode whenever i use a value with non-ascii chars. This seems to be due to the fact that twisted's log.msg funcition is not unicode aware (and in fact twisted's api discourage logging unicode data, see http://twistedmatrix.com/documents/current/api/twisted.python.log.LogPublisher.html#msg)

the attached code should fix the issue by encoding strings before writing to logfiles.

bye,
flavio