-
Notifications
You must be signed in to change notification settings - Fork 2
pyDKB: improve logging system. #274
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
Conversation
588b5ff to
a9da4f2
Compare
This type (fixed set of service words) looks like the one that will be used across the whole library, not in the `dataflow` module alone.
Now and then we need to output some log message from the module body, not from an object (e.g. warn message about failed import). It does not look good to write something like `LoggableObject.log(msg)`; simple `log(msg)` looks better for me.
If used from `LoggableObject`, prefix is the caller class name (passed via `LoggableObject.log` method). If no prefix passed, caller module name is used instead. `LoggableObject` method does not support additional prefixes, yet if `log` function is called directly, prefixes can be passed and in this case caller `__name__` should be passed explicitly.
a9da4f2 to
d3761de
Compare
bfc5767 to
82561c6
Compare
3e5fb3e to
97177b5
Compare
|
Bugs fixed, please re-review the PR. |
|
I have some other concerns regarding this PR and log system changes, but I'll voice them either on team meeting or through mail. |
Now `log('')` and `log('\n\n\n')` output nothing and multiple newline
symbols are ignored:
```
>>> log('')
>>> log('\n\n\n\n')
>>>
>>> log('a\n\n\n\n')
2019-08-30 11:45:04 (INFO) (main) a
>>> log('a\n\n\nb\n')
2019-08-30 11:45:10 (INFO) (main) a
(==) b
>>> log(['a\n\n\nb\n', 'ccc', 'de\n\nf\n'])
2019-08-30 11:45:28 (INFO) (main) a
(==) b
(==) ccc
(==) de
(==) f
```
Evildoor
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My comments were answered and I don't see anything else to comment on.
|
@Evildoor, I have just updated the |
While #135 is an attempt to do something more elegant, this PR simpy makes the code more DRY and improves log messages style.
(Waiting for: #273)(merged)