X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d4b73b1b8e585418459362c9bf9173aa21da8c41..f18eaf2687ab42c97ccf469a2617306cadc0c6ef:/wxPython/wx/tools/dbg.py?ds=sidebyside diff --git a/wxPython/wx/tools/dbg.py b/wxPython/wx/tools/dbg.py index 5c791f8864..e58be4cd05 100644 --- a/wxPython/wx/tools/dbg.py +++ b/wxPython/wx/tools/dbg.py @@ -75,7 +75,8 @@ stream changing it will result in no action being taken. You can also call the log function implicitly on the Logger -instance, ie. you can type: +instance, ie. you can type:: + from wxPython.tools.dbg import Logger dbg = Logger() dbg('something to print') @@ -147,8 +148,14 @@ class Logger: return if self._dbg and len(args) and not self._suspend: - # (emulate print functionality) - strs = [str(arg) for arg in args] + # (emulate print functionality; handle unicode as best as possible:) + strs = [] + for arg in args: + try: + strs.append(str(arg)) + except: + strs.append(repr(arg)) + output = ' '.join(strs) if self.name: output = self.name+': ' + output output = ' ' * 3 * self._indent + output