Paulino schrieb:
> Thank You, for your answer!
>
> I'm sorry I'm not sure I understand what you mean by "print the
> arguments to the log"
There should be a logging.Logger instance in your controller. If not,
get it via
import logging
log = logging.getLogger("<your_project_module_name>.controllers")
> Here's what I did
>
> meulog = file('mini_log', 'w')
> sys.stdout = meulog
> print renda
>
>
> I get the UnicodeDecodeError when printing to the log
>
>
> File "/home/paulino/tgears/rendas.org/rendas/controllers.py", line
> 153, in meuLog
> print renda
> UnicodeEncodeError: 'ascii' codec can't encode characters in position
> 2-3: ordinal not in range(128)
You need to convert unicode-instances to byte-strings first. But I
_think_ the logger will do that for you. If not, do this:
logger.debug(renda.encode('utf-8'))
Diez
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---