Conversation
Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>
Co-authored-by: Andrew Carbonetto <andrew.carbonetto@improving.com>
Co-authored-by: Andrew Carbonetto <andrew.carbonetto@improving.com>
Java: Add Logger
|
Panic handling is coming in a separate PR that overhauls how we handle errors in the FFI layer in general. |
|
@jonathanl-bq Ping me when it's ready |
The panic handling changes got merged already: |
Yury-Fridlyand
left a comment
There was a problem hiding this comment.
More logging todos were merged today, sorry.
Please see MessageHandler and #1662
|
@barshaul round |
java/client/src/main/java/glide/connectors/handlers/MessageHandler.java
Outdated
Show resolved
Hide resolved
…dler.java Co-authored-by: Yury-Fridlyand <yury.fridlyand@improving.com>
| @Getter private static Level loggerLevel; | ||
|
|
||
| private static void initLogger(@NonNull Level level, String fileName) { | ||
| if (level == Level.DISABLED) { |
There was a problem hiding this comment.
DISABLED option was added to Java side for testing, since we don't want to log when we have mocks. There's other ways to do it (mocking static objects is annoying, but possible), but this is the best way.
| @BeforeEach | ||
| @SneakyThrows | ||
| public void createTestClient() { | ||
| Logger.setLoggerConfig(Logger.Level.DISABLED); |
There was a problem hiding this comment.
Right - this is why we need a DISABLED level logger.
Can we add a TODO to add this level to the redis-core side?
java/client/src/main/java/glide/connectors/handlers/MessageHandler.java
Outdated
Show resolved
Hide resolved
java/client/src/main/java/glide/connectors/handlers/MessageHandler.java
Outdated
Show resolved
Hide resolved
* Implement Logger for Java client Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com> Co-authored-by: Yury-Fridlyand <yury.fridlyand@improving.com> Co-authored-by: Andrew Carbonetto <andrew.carbonetto@improving.com>
* Implement Logger for Java client Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com> Co-authored-by: Yury-Fridlyand <yury.fridlyand@improving.com> Co-authored-by: Andrew Carbonetto <andrew.carbonetto@improving.com>
Issue #, if available:
N/A
The Logger implementation here is based on the Python client's implementation, with some relatively small Java/JNI specific changes.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.