-
Notifications
You must be signed in to change notification settings - Fork 93
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
Consider using logging #690
Comments
Thanks @liangxin1300, If you think this is a duplicate, you can close this issue. :-) All fine, it's just an idea, no hurry. |
I second the request to improve loggin facility in general. Here is an example I encountered. Two findings: 1). When crm exits abnornally or even success for 2). Error messages are treated differently, not aligned. Example below, the first Error message only exists in ha-cluster-boostrap.log, not in the stdout.
|
and
Both issues can be tackled with Python's logging module. It's just a matter of configuration. For example, you could define your configuration in a way that it will log all events into a file and to some degree to stdout/stderr. Depending on your wishes, you could output different information for different output handlers. You could even sent a mail to a specific server. Here is an short example to demonstrate the basic principle: I would highly recommend to NOT use the root logger but create your own logger instance. Especially if someone wants to import the crmsh as a library (is that possible?) you have a dedicated logger. |
Okay, some other questions to think about:
|
Added the same finish statement when finished removing node
Changed as |
@tomschr ,
I think be in dictionary way will be good enough:)
Yes, both in console and
Yes, I have implemented hierarchical loggers Thanks for your nice suggestions! |
@liangxin1300 That looks really great! 👍 Congrats for your implementation, well done! |
Situation
This is more of a long term idea than an actual bug report.
After looking into the code, it seems that Python's logging module isn't used at all. There is a
crmsh.msg
package which tries to emulate(?) logging. It looks like it replicates the work what logging already does, so I fear, this is just reinventing the wheel. 😉Suggested idea
Maybe there is a reason why this is the case. If feasible, I would suggest use logging instead of
ErrorBuffer
class as a long term strategy. The logging module has the following benefits:For more information
The text was updated successfully, but these errors were encountered: