-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enabled per-module logging level settings #41
base: dev
Are you sure you want to change the base?
Conversation
I've also added a bug fix in disposing output of Skype. |
Nice! I think we can make this little bit simpler. Python has internal config file format to configure loggers: http://docs.python.org/2/library/logging.config.html We just create logging.conf which is read on the start up and "outsource" all logging configuration for it. It has more powerful syntax and people are more familiar with it, because the format is used in other applications too. In fact we can rip off some existing logging configuration options from settings.py and just put into this file. This reduces the amount of code we need to maintain ourselves. Also, there is another trick:
... useful for modules get renamed and shuffled around. |
Outsourced all logging configurations to These changes show just a simple way to do it. Some design decisions and considerations:
|
I think we can just ship with one logging.conf and set it to gitingore so users don't push this around. settings.conf.example is with .example extension only because it contains a default password. Logging configuration does not have similar security risk, so we can happily have default logging.conf in place. |
Mmm... I just give it a thought regarding settings.py.example. We could ship with settings.py. On startup, Sevabot reads the file. If there is a default password, it is changed to random string which is then printed to stderr and settings are reloaded. This way we can avoid unnecessary manual password set process and make the bot initial start up process streamlined. Some work though, and not very high priority. |
I think |
Anyway we have to gitignore |
These changes make debugging modules easier.