sschuberth commented on code in PR #137:
URL:
https://github.com/apache/logging-log4j-kotlin/pull/137#discussion_r2383225191
##########
log4j-api-kotlin/src/main/kotlin/org/apache/logging/log4j/kotlin/LoggingFactory.kt:
##########
@@ -34,6 +34,11 @@ inline fun <reified T : Any> T.logger() =
loggerOf(T::class.java)
*
* @since 1.3.0
*/
+@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
Review Comment:
`WARNING` is the default and can be dropped.
##########
log4j-api-kotlin-sample/src/main/kotlin/org/apache/logging/log4j/kotlin/sample/LoggingAppExtensionProperty.kt:
##########
@@ -45,7 +45,7 @@ object LoggingAppExtensionProperty {
}
fun getKey(): Int = logger.runInTrace {
- Random().nextInt(10)
+ Random.nextInt(10)
Review Comment:
This (and line 22) should go to a separate commit with a separate rationale
in the commit message IMO.
##########
log4j-api-kotlin/src/main/kotlin/org/apache/logging/log4j/kotlin/autoprop/LoggingFactoryAutoProp.kt:
##########
@@ -0,0 +1,27 @@
+package org.apache.logging.log4j.kotlin.autoprop
Review Comment:
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"?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]