pyDKB: improve logging system.#274
Merged
Merged
Conversation
mgolosova
force-pushed
the
pyDKB-loggable-object
branch
from
July 9, 2019 12:35
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.
mgolosova
force-pushed
the
pyDKB-loggable-object
branch
from
July 10, 2019 11:46
a9da4f2 to
d3761de
Compare
mgolosova
force-pushed
the
pyDKB-loggable-object
branch
from
July 10, 2019 12:06
bfc5767 to
82561c6
Compare
mgolosova
force-pushed
the
pyDKB-loggable-object
branch
from
July 10, 2019 12:25
3e5fb3e to
97177b5
Compare
anastasiakaida
previously approved these changes
Jul 31, 2019
Evildoor
reviewed
Aug 1, 2019
Evildoor
reviewed
Aug 1, 2019
Collaborator
Author
|
Bugs fixed, please re-review the PR. |
Evildoor
reviewed
Aug 6, 2019
Evildoor
reviewed
Aug 6, 2019
Contributor
|
I have some other concerns regarding this PR and log system changes, but I'll voice them either on team meeting or through mail. |
3 tasks
Evildoor
reviewed
Aug 26, 2019
Evildoor
reviewed
Aug 26, 2019
Evildoor
reviewed
Aug 26, 2019
Evildoor
reviewed
Aug 26, 2019
Evildoor
reviewed
Aug 26, 2019
Evildoor
reviewed
Aug 26, 2019
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
previously approved these changes
Sep 12, 2019
Evildoor
left a comment
Contributor
There was a problem hiding this comment.
My comments were answered and I don't see anything else to comment on.
Collaborator
Author
|
@Evildoor, I have just updated the |
Evildoor
approved these changes
Sep 16, 2019
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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)