Skip to content

Conversation

@rdblue
Copy link
Contributor

@rdblue rdblue commented Nov 25, 2015

This removes the Log implementation based on java.util.logging and
replaces it with SLF4J. The compiler removal of debug log messages still
works because Log.DEBUG and similar final constants are unchanged.

This commit adds slf4j-simple as the test logger implementation.
Configuration for slf4j-simple is in the root pom. Two modules can't use
slf4j-simple, parquet-pig and parquet-thrift, and use slf4j-log4j12
instead because pig depends on log4j and tests die without it.

This removes the Log implementation based on java.util.logging and
replaces it with SLF4J. The compiler removal of debug log messages still
works because Log.DEBUG and similar final constants are unchanged.

The Log class and API is now deprecated in favor of using SLF4J
directly. The main reason is to avoid expensive string construction when
possible by exposing the full SLF4J API.

This commit adds slf4j-simple as the test logger implementation.
Configuration for slf4j-simple is in the root pom. Two modules can't use
slf4j-simple, parquet-pig and parquet-thrift, and use slf4j-log4j12
instead because pig depends on log4j and tests die without it.
@rdblue
Copy link
Contributor Author

rdblue commented Nov 25, 2015

@julienledem, as long as I was changing the logging code to fix PARQUET-305, I went ahead and switched it over to SLF4J. Could you have a look?

I marked the Log API deprecated. Do you think we should take the time right now to move off of it completely, or do it over the next release?

@julienledem
Copy link
Member

Thanks for updating the dependency and use slf4j under the hood.
I don't see the need to migrate all the logs to the slf4j api.
I would not deprecate the Log class and just keep it as is as a thin wrapper to slf4j.

@rdblue
Copy link
Contributor Author

rdblue commented Nov 30, 2015

The problem with not moving to the slf4j API is that it forces the caller to do a lot of string manipulation to construct a log message regardless of whether it is actually used. The varargs style API defers constructing the log message.

I also don't see much value in having a wrapper around the logging implementation, since that is what slf4j is supposed to do. That API already allows the downstream application to switch out the logger implementation used by Parquet.

My reasoning is: why maintain our own API when it results in not being able to use features of the underlying one that is already general-purpose?

Copy link
Member

Choose a reason for hiding this comment

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

I'd rather not make this deprecated in this PR since it will make every class have warnings.
Otherwise, this looks good to me.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No problem. I'll open a follow-up issue for further discussion. We can deprecate and remove the use of this class for that issue instead of dragging out this one.

Copy link
Member

Choose a reason for hiding this comment

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

SGTM. Thanks

@julienledem
Copy link
Member

+1

@asfgit asfgit closed this in a24d624 Dec 8, 2015
@lw-lin
Copy link
Contributor

lw-lin commented Feb 1, 2016

hi @rdblue, I wonder if there is any following-up discussion/JIRA/PR concerning replacing the use of Log.java with slf4j? Maybe I can do the replacing, should we reach consensus.

@julienledem
Copy link
Member

I don't recall there's a jira already. If not please make one so that we can have the discussion.

@rdblue
Copy link
Contributor Author

rdblue commented Feb 1, 2016

I opened an issue to move over to SLF4J already. It is: https://issues.apache.org/jira/browse/PARQUET-401

piyushnarang pushed a commit to piyushnarang/parquet-mr that referenced this pull request Jun 15, 2016
This removes the Log implementation based on java.util.logging and
replaces it with SLF4J. The compiler removal of debug log messages still
works because Log.DEBUG and similar final constants are unchanged.

This commit adds slf4j-simple as the test logger implementation.
Configuration for slf4j-simple is in the root pom. Two modules can't use
slf4j-simple, parquet-pig and parquet-thrift, and use slf4j-log4j12
instead because pig depends on log4j and tests die without it.

Author: Ryan Blue <blue@apache.org>

Closes apache#290 from rdblue/PARQUET-305-update-logging and squashes the following commits:

89257e8 [Ryan Blue] PARQUET-305: Remove deprecation annotations on Log.
9f9b99a [Ryan Blue] PARQUET-305: Update logging to SLF4J.
rdblue added a commit to rdblue/parquet-mr that referenced this pull request Jul 13, 2016
This removes the Log implementation based on java.util.logging and
replaces it with SLF4J. The compiler removal of debug log messages still
works because Log.DEBUG and similar final constants are unchanged.

This commit adds slf4j-simple as the test logger implementation.
Configuration for slf4j-simple is in the root pom. Two modules can't use
slf4j-simple, parquet-pig and parquet-thrift, and use slf4j-log4j12
instead because pig depends on log4j and tests die without it.

Author: Ryan Blue <blue@apache.org>

Closes apache#290 from rdblue/PARQUET-305-update-logging and squashes the following commits:

89257e8 [Ryan Blue] PARQUET-305: Remove deprecation annotations on Log.
9f9b99a [Ryan Blue] PARQUET-305: Update logging to SLF4J.
rdblue added a commit to rdblue/parquet-mr that referenced this pull request Jan 6, 2017
This removes the Log implementation based on java.util.logging and
replaces it with SLF4J. The compiler removal of debug log messages still
works because Log.DEBUG and similar final constants are unchanged.

This commit adds slf4j-simple as the test logger implementation.
Configuration for slf4j-simple is in the root pom. Two modules can't use
slf4j-simple, parquet-pig and parquet-thrift, and use slf4j-log4j12
instead because pig depends on log4j and tests die without it.

Author: Ryan Blue <blue@apache.org>

Closes apache#290 from rdblue/PARQUET-305-update-logging and squashes the following commits:

89257e8 [Ryan Blue] PARQUET-305: Remove deprecation annotations on Log.
9f9b99a [Ryan Blue] PARQUET-305: Update logging to SLF4J.
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.

3 participants