Python has an official 'logging' module. I've used it a bit, and it
really wasn't as bad an I remembered it to be ;-). It is more on the
side of "powerful" than "simple", though.
Perhaps we should investigate using it for logging inside leo as well.
Plugins could specify their log domains etc. It would also be possible
to redirect logs to leo log windows, or wherever.
Great idea. A lot of work has gone into logging, including, I believe,
simplification.
tools extending logging:
http://plumberjack.blogspot.com/p/handlers-for-logging.html
I would love it if a logger was available to <ctl b> and buttons.
Logging seems related to testing in a "best practices" sort of way.
Thanks,
Kent
>
>
> tools extending logging:
> http://plumberjack.blogspot.com/p/handlers-for-logging.html
Ok, we should probably adapt this to Qt, in order to support logging
to leo panes:
>> Python has an official 'logging' module. I've used it a bit, and it
>> really wasn't as bad an I remembered it to be ;-). It is more on the
>> side of "powerful" than "simple", though.
Leo has a good logger. It's called g.trace. The most important
contribution you can make, Ville, to Python 3.x compatibility is to
use g.trace instead of print :-)
I myself have zero interest in Python's logging module, but it would
be easy enough to add more features to g.trace: log to log pane, log
to file, log to logging.Logger objects, etc.
At the code level it would be easy to extend g.trace because it's
signature is already g.trace(*args,**keys).
Edward