On Wednesday 04 March 2009 16:52:30 Bo Peng wrote:
> Dear all,
>
> A Tee class is defined in lib/configure.py. Writing to this object
> writes to the standard console as well as a logfile. This is clever,
> well, for a Python newbie who learned Python but not its standard
> libraries.

I am not sure if that was the original reason. logging has appeared in python 
2.3 and initially for lyx 1.4 we planned for python 2.2. I am not sure if that 
is the reason FWIW I am just adding this to be fair.

> The right way to do this is to use the Python logging module. In the
> attached patch (against branch), a logging object is created to write
> to a log file as well as the console. The advantage of this method is
> that a) it is the Pythonic way. b). messages could be written to
> different handlers (console or logfile) depending on their severity.
> For example, the actual RC lines are added to the logfile for
> debugging purposes.

I agree.

> The patch works here (Python 2.4) but is NOT tested thoroughly. Note
> that the logging module should be added to the windows installer if
> this patch is adopted.

This code could go in to devel. The code looks good and it is very useful.

> Cheers,
> Bo

-- 
José Abílio

Reply via email to