Skip to content
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

Closed
wants to merge 2 commits into from

Conversation

allisonport-db
Copy link
Collaborator

Which Delta project/connector is this regarding?

  • Spark
  • Standalone
  • Flink
  • Kernel
  • Other (fill in here)

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.

@@ -356,31 +359,32 @@ protected Optional<LogSegment> getLogSegmentForVersion(
final List<FileStatus> checkpoints = checkpointsAndDeltas._1;
final List<FileStatus> deltas = checkpointsAndDeltas._2;

logDebug(() ->
logger.atDebug().setMessage(() ->
Copy link
Collaborator

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?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

@vkorukanti vkorukanti left a 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);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit:

Suggested change
logger.debug("startVersion: {}, versionToLoad{}", startVersion, versionToLoad);
logger.debug("startVersion: {}, versionToLoad {}", startVersion, versionToLoad);

Copy link
Collaborator

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);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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
Copy link
Collaborator

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?

Copy link
Collaborator Author

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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request][Kernel] Logging framework
3 participants