waartaa / ircb

A versatile IRC bouncer for humans
MIT License
49 stars 15 forks source link

Add a logging framework #43

Closed sayanchowdhury closed 8 years ago

slick666 commented 8 years ago

+1

slick666 commented 8 years ago

@sayanchowdhury we should probably add a "feature" flag to this and a milestone if possible.

It looks like we already have some logging defined in the config.py. While we have each one named explicitly I think we could move to using the module hierarchy to accomplish the same thing. This is that logging.getLogger(__name__) pattern. Everything would roll up to the root and by default would be logged to the console. If someone wanted to take the stores for example. They could define that handler and either propagate that up (default) or isolate the logging to that particular method.

Does this make sense? what are your thoughts on this?

sayanchowdhury commented 8 years ago

I was actually planning on the same lines. My plan was to place the loading of config into the base command so that it's available as soon as we hit any command and then have a common handler ircb.for logging

slick666 commented 8 years ago

@sayanchowdhury, I'll knock out a first draft of that as soon as I can and we can go from there.

sayanchowdhury commented 8 years ago

@slick666 So, I have pushed a load_config function here which is called here. Comments?

/cc @rtnpro