[IPython-User] How to enable timestamped logging?

Comer Duncan comer.duncan@gmail....
Sun Mar 18 12:44:14 CDT 2012


Hi Thomas,

I replaced the code with a u prepending in 05_log.py, moved the file
again into startup and started the notebook again. Again I get an
error. This time I am pasting the ungood output that I get. Maybe it
is a different problem?

In [2]:

F
---------------------------------------------------------------------------
UnicodeEncodeError                        Traceback (most recent call last)
/Users/comerduncan/ipythonnotebooks/<ipython-input-2-d2a33790e5bf> in <module>()
----> 1 F

/Users/comerduncan/ipython/IPython/core/displayhook.pyc in
__call__(self, result)
    239             self.write_format_data(format_dict)
    240             self.update_user_ns(result)
--> 241             self.log_output(format_dict)
    242             self.finish_displayhook()
    243

/Users/comerduncan/ipython/IPython/core/displayhook.pyc in
log_output(self, format_dict)
    217         """Log the output."""
    218         if self.shell.logger.log_output:
--> 219
self.shell.logger.log_write(format_dict['text/plain'], 'output')
    220
self.shell.history_manager.output_hist_reprs[self.prompt_count] = \
    221
format_dict['text/plain']

/Users/comerduncan/ipython/IPython/core/logger.pyc in log_write(self,
data, kind)
    197                 odata = '\n'.join(['#[Out]# %s' % s
    198                                    for s in data.splitlines()])
--> 199                 write('%s\n' % odata)
    200             self.logfile.flush()
    201

UnicodeEncodeError: 'ascii' codec can't encode character u'\u23a1' in
position 17: ordinal not in range(128)

Thanks,

Comer


On Sun, Mar 18, 2012 at 9:57 AM, Thomas Kluyver <takowl@gmail.com> wrote:
> On 18 March 2012 12:23, klo uo <klonuo@gmail.com> wrote:
>> I enabled logging in ipython_config.py and can't see how to apply your
>> suggestion.
>
> Have a look at the code for magic_logstart (in IPython.core.magic),
> and see what the -t option sets. This cookbook entry might also be a
> good place to start: http://wiki.ipython.org/Cookbook/DatedLog
>
> Thomas
> _______________________________________________
> IPython-User mailing list
> IPython-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-user


More information about the IPython-User mailing list