On 4/27/06, fumanchu <[EMAIL PROTECTED]> wrote:
> How odd. I was just going to spend my morning writing a new log Tool
> for CP 3 that uses the builtin logging module.
And I spent my morning fixing up TurboGears' logging configuration :)
>
> Question for you: in Dejavu, I decided that providing a logger was
> outside the scope, since Dejavu is meant to be a library, not a
> framework. However, I still needed to provide a way to log events in
> Dejavu code. I ended up putting a "log" function on the arena:
>
> def log(self, message, flag):
> """Default logger (writes to stdout). Feel free to replace."""
> if flag & self.logflags:
> if isinstance(message, unicode):
> print message.encode('utf8')
> else:
> print message
>
> ...with the expectation that users would monkeypatch in their own log
> function as needed. I like the DRY-ness of this approach.
Why not just using the logging module with well-defined categories?
Kevin
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears Trunk" 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-trunk
-~----------~----~----~----~------~----~------~--~---