You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by vy...@apache.org on 2024/09/09 11:00:54 UTC
(logging-log4j-scala) branch main updated: Rework `traceEntry()` to avoid inlining warnings (#62)
This is an automated email from the ASF dual-hosted git repository.
vy pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/logging-log4j-scala.git
The following commit(s) were added to refs/heads/main by this push:
new 8a1646c Rework `traceEntry()` to avoid inlining warnings (#62)
8a1646c is described below
commit 8a1646c6b58a2533598c628d1cfa38af0e35279e
Author: PJ Fanning <pj...@users.noreply.github.com>
AuthorDate: Mon Sep 9 12:00:49 2024 +0100
Rework `traceEntry()` to avoid inlining warnings (#62)
---
.../src/main/scala/org/apache/logging/log4j/scala/Logger.scala | 7 ++++---
.../src/main/scala/org/apache/logging/log4j/scala/Logger.scala | 7 ++++---
2 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/log4j-api-scala_2.10/src/main/scala/org/apache/logging/log4j/scala/Logger.scala b/log4j-api-scala_2.10/src/main/scala/org/apache/logging/log4j/scala/Logger.scala
index 1d0024f..4ee7d07 100644
--- a/log4j-api-scala_2.10/src/main/scala/org/apache/logging/log4j/scala/Logger.scala
+++ b/log4j-api-scala_2.10/src/main/scala/org/apache/logging/log4j/scala/Logger.scala
@@ -433,9 +433,10 @@ class Logger private(val delegate: ExtendedLogger) extends AnyVal {
* @return The built `EntryMessage`
*/
def traceEntry(params: AnyRef*): EntryMessage = {
- params match {
- case Seq() => delegate.traceEntry()
- case seq => delegate.traceEntry(seq.head.toString, seq.tail:_*)
+ if (params.isEmpty) {
+ delegate.traceEntry()
+ } else {
+ delegate.traceEntry(params.head.toString, params.tail:_*)
}
}
diff --git a/log4j-api-scala_3/src/main/scala/org/apache/logging/log4j/scala/Logger.scala b/log4j-api-scala_3/src/main/scala/org/apache/logging/log4j/scala/Logger.scala
index 8184496..5b677c3 100644
--- a/log4j-api-scala_3/src/main/scala/org/apache/logging/log4j/scala/Logger.scala
+++ b/log4j-api-scala_3/src/main/scala/org/apache/logging/log4j/scala/Logger.scala
@@ -434,9 +434,10 @@ class Logger private(val delegate: ExtendedLogger) extends AnyVal {
* @return The built `EntryMessage`
*/
inline def traceEntry(inline params: AnyRef*): EntryMessage = {
- params match {
- case Seq() => delegate.traceEntry()
- case seq => delegate.traceEntry(seq.head.toString, seq.tail:_*)
+ if (params.isEmpty) {
+ delegate.traceEntry()
+ } else {
+ delegate.traceEntry(params.head.toString, params.tail:_*)
}
}