Replies: 2 comments
-
Additional methods were added to support primitive adding primitive types as arguments. See the changes to |
Beta Was this translation helpful? Give feedback.
-
I have a proposition of another nature. For how to augment the existing SLF4J. Which I would like to show. I can enhance and augment the existing Things that are easy to use often have a more complex definition. A definition may open up for enhancing and expanding, which may lead to something simpler in its usage, given that you control its point-of-origin. A straightforward usage of the existing SLF4J API may look like this:
An augmented usage can appear like this:
I like the original
Then I proceed and say that I want some basic aliases, making log-lines shorter:
In parallel with this, I add methods with a much more aggressive, short naming -- not to the liking of everyone, possibly myself included --:
The two alias-objects know nothing about each other, nor does the root interface The return type can be used to tie these interfaces together so they can be used as one, which may be defined like this:
What is left is to control the point-of-origin. In comes the Now, if I become sad about my two sets of aliases then it is within reach to dump them again. The root interface References:
Please note that while I am trying to show an example of a different path, which I am sure may trigger additional thoughts, I am not really commenting upon the 2.1.x-alpha version (besides, it may be around 12 months too late). What I am saying is that a complex definition can lead to a simple usage. The definition of As one last thing, beyond adding new methods for convenience, in which case controlling the point-of-origin appears as an ill-advised burden, I can see other types of integration with a logging API like SLF4J, like what I so far have called "rate-limited logging", which makes a new point-of-origin a much welcome point-of-integration -- possibly allowing for the chaining of different actions, responsiblities implemented and uphold by different libraries, into one. While keeping log-statements within one line of source code. Who says that all our interfaces should be equal, or dictate if I am supposed to use Lombok There is quite a lot to be said about this. |
Beta Was this translation helpful? Give feedback.
-
There has been a request to add support for primitive types in
addArgument
andaddKeyValue
methods inLoggingEventBuilder
.Moreover, it might be reasonable to add shorter synonyms for
addArgument()
andaddKeyValue()
methods, such asarg()
andkvp()
.For more details see LoggingEventBuilder javadocs
See also issues/375
Beta Was this translation helpful? Give feedback.
All reactions