Skip to content

Conversation

@rocketraman
Copy link
Member

The logger property conflicts with explicitly defined logger properties. Given the performance considerations of the logger property, move it to a separate package so imports of it are explicit and non-conflicting.

Resolves #136


fun getKey(): Int = logger.runInTrace {
Random().nextInt(10)
Random.nextInt(10)

Choose a reason for hiding this comment

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

This (and line 22) should go to a separate commit with a separate rationale in the commit message IMO.

Copy link
Member Author

Choose a reason for hiding this comment

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

Agreed, I'll revert this unrelated change.

@Deprecated(
"Replace with autoprop.logger to avoid unintended consequences with explicitly declared logger properties. This will be removed in the next major release.",
replaceWith = ReplaceWith("logger", "org.apache.logging.log4j.kotlin.autoprop.logger"),
level = DeprecationLevel.WARNING

Choose a reason for hiding this comment

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

WARNING is the default and can be dropped.

@@ -0,0 +1,27 @@
package org.apache.logging.log4j.kotlin.autoprop

Choose a reason for hiding this comment

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

Note auto about the package name... "auto" sounds like more magic than there actually is. It's just a regular extension property. So maybe call the package "extension"?

@rocketraman rocketraman force-pushed the rg/136-logger-property-package-change branch from f0195c5 to b64b0f2 Compare September 30, 2025 13:00
@rocketraman rocketraman force-pushed the rg/136-logger-property-package-change branch from b64b0f2 to db0053f Compare September 30, 2025 13:11
* Simply import this property and use it.
*
* ```
* import org.apache.logging.log4j.kotlin.autoprop.logger

Choose a reason for hiding this comment

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

This should now say org.apache.logging.log4j.kotlin.extension.logger as well.

Copy link
Member Author

Choose a reason for hiding this comment

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

Oops, fixed

*/
@Deprecated(
"Replace with autoprop.logger to avoid unintended consequences with explicitly declared logger properties. This will be removed in the next major release.",
replaceWith = ReplaceWith("logger", "org.apache.logging.log4j.kotlin.autoprop.logger")

Choose a reason for hiding this comment

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

This should now say org.apache.logging.log4j.kotlin.extension.logger as well.

Choose a reason for hiding this comment

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

Both lines, actually.

The `logger` property conflicts with explicitly defined logger properties.
Given the performance considerations of the `logger` property, move it to
a separate package so imports of it are explicit and non-conflicting.

Resolves apache#136
@rocketraman rocketraman force-pushed the rg/136-logger-property-package-change branch from db0053f to e116cf7 Compare September 30, 2025 13:29
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.

Remove logger property

2 participants