-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[Kernel] Use SLF4J for logging in kernel-api #2305
Conversation
@@ -356,31 +359,32 @@ protected Optional<LogSegment> getLogSegmentForVersion( | |||
final List<FileStatus> checkpoints = checkpointsAndDeltas._1; | |||
final List<FileStatus> deltas = checkpointsAndDeltas._2; | |||
|
|||
logDebug(() -> | |||
logger.atDebug().setMessage(() -> |
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.
what's this .setMessage
API? I googled around but couldn't find it. Could you link to it? Does it just take a in a supplier?
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.
Yep, fluent logging API and java docs
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.
lgtm
@@ -158,7 +161,7 @@ protected final Optional<List<FileStatus>> listDeltaAndCheckpointFiles( | |||
TableClient tableClient, | |||
long startVersion, | |||
Optional<Long> versionToLoad) { | |||
logDebug(String.format("startVersion: %s, versionToLoad: %s", startVersion, versionToLoad)); | |||
logger.debug("startVersion: {}, versionToLoad{}", startVersion, versionToLoad); |
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.
nit:
logger.debug("startVersion: {}, versionToLoad{}", startVersion, versionToLoad); | |
logger.debug("startVersion: {}, versionToLoad {}", startVersion, versionToLoad); |
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.
nit: versionToLoad: {}
(colon)
@@ -227,7 +230,7 @@ private SnapshotImpl createSnapshot( | |||
.checkpointVersionOpt | |||
.map(v -> String.format(" starting from checkpoint version %s.", v)) | |||
.orElse("."); | |||
logInfo(() -> String.format("Loading version %s%s", initSegment.version, startingFromStr)); | |||
logger.info("Loading version {}{}", initSegment.version, startingFromStr); |
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.
logger.info("Loading version {}{}", initSegment.version, startingFromStr); | |
logger.info("Loading version {} {}", initSegment.version, startingFromStr); |
# limitations under the License. | ||
# | ||
# | ||
# Licensed to the Apache Software Foundation (ASF) under one or more |
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.
why do we need two licenses here?
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.
I copied these from connectors
I'm assuming they were originally copied from Spark
# limitations under the License. | ||
# | ||
# | ||
# Licensed to the Apache Software Foundation (ASF) under one or more |
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.
same here.
Which Delta project/connector is this regarding?
Description
Resolves #2230
Uses SLF4J for logging in kernel-API. See #2230 for the decision doc on this.
Also adds log4j for logging in tests.
How was this patch tested?
Temporarily changed log level=DEBUG and ran tests in both kernelApi and kernelDefaults and confirmed that logs were outputted.