Skip to content

Commit f917dbd

Browse files
committed
Generate arrays instead of lists for varargs
Generate arrays instead of lists for varargs as they would have to be converted anyways.
1 parent 28b0942 commit f917dbd

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/main/scala/com/typesafe/scalalogging/LoggerMacro.scala

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ private object LoggerMacro {
4040
import c.universe._
4141
val underlying = q"${c.prefix}.underlying"
4242
if (args.length == 2)
43-
q"if ($underlying.isErrorEnabled) $underlying.error($message, _root_.scala.List(${args(0)}, ${args(1)}): _*)"
43+
q"if ($underlying.isErrorEnabled) $underlying.error($message, _root_.scala.Array(${args(0)}, ${args(1)}): _*)"
4444
else
4545
q"if ($underlying.isErrorEnabled) $underlying.error($message, ..$args)"
4646
}
@@ -60,7 +60,7 @@ private object LoggerMacro {
6060
import c.universe._
6161
val underlying = q"${c.prefix}.underlying"
6262
if (args.length == 2)
63-
q"if ($underlying.isErrorEnabled) $underlying.error($marker, $message, _root_.scala.List(${args(0)}, ${args(1)}): _*)"
63+
q"if ($underlying.isErrorEnabled) $underlying.error($marker, $message, _root_.scala.Array(${args(0)}, ${args(1)}): _*)"
6464
else
6565
q"if ($underlying.isErrorEnabled) $underlying.error($marker, $message, ..$args)"
6666
}
@@ -82,7 +82,7 @@ private object LoggerMacro {
8282
import c.universe._
8383
val underlying = q"${c.prefix}.underlying"
8484
if (args.length == 2)
85-
q"if ($underlying.isWarnEnabled) $underlying.warn($message, _root_.scala.List(${args(0)}, ${args(1)}): _*)"
85+
q"if ($underlying.isWarnEnabled) $underlying.warn($message, _root_.scala.Array(${args(0)}, ${args(1)}): _*)"
8686
else
8787
q"if ($underlying.isWarnEnabled) $underlying.warn($message, ..$args)"
8888
}
@@ -102,7 +102,7 @@ private object LoggerMacro {
102102
import c.universe._
103103
val underlying = q"${c.prefix}.underlying"
104104
if (args.length == 2)
105-
q"if ($underlying.isWarnEnabled) $underlying.warn($marker, $message, _root_.scala.List(${args(0)}, ${args(1)}): _*)"
105+
q"if ($underlying.isWarnEnabled) $underlying.warn($marker, $message, _root_.scala.Array(${args(0)}, ${args(1)}): _*)"
106106
else
107107
q"if ($underlying.isWarnEnabled) $underlying.warn($marker, $message, ..$args)"
108108
}
@@ -124,7 +124,7 @@ private object LoggerMacro {
124124
import c.universe._
125125
val underlying = q"${c.prefix}.underlying"
126126
if (args.length == 2)
127-
q"if ($underlying.isInfoEnabled) $underlying.info($message, _root_.scala.List(${args(0)}, ${args(1)}): _*)"
127+
q"if ($underlying.isInfoEnabled) $underlying.info($message, _root_.scala.Array(${args(0)}, ${args(1)}): _*)"
128128
else
129129
q"if ($underlying.isInfoEnabled) $underlying.info($message, ..$args)"
130130
}
@@ -144,7 +144,7 @@ private object LoggerMacro {
144144
import c.universe._
145145
val underlying = q"${c.prefix}.underlying"
146146
if (args.length == 2)
147-
q"if ($underlying.isInfoEnabled) $underlying.info($marker, $message, _root_.scala.List(${args(0)}, ${args(1)}): _*)"
147+
q"if ($underlying.isInfoEnabled) $underlying.info($marker, $message, _root_.scala.Array(${args(0)}, ${args(1)}): _*)"
148148
else
149149
q"if ($underlying.isInfoEnabled) $underlying.info($marker, $message, ..$args)"
150150
}
@@ -166,7 +166,7 @@ private object LoggerMacro {
166166
import c.universe._
167167
val underlying = q"${c.prefix}.underlying"
168168
if (args.length == 2)
169-
q"if ($underlying.isDebugEnabled) $underlying.debug($message, _root_.scala.List(${args(0)}, ${args(1)}): _*)"
169+
q"if ($underlying.isDebugEnabled) $underlying.debug($message, _root_.scala.Array(${args(0)}, ${args(1)}): _*)"
170170
else
171171
q"if ($underlying.isDebugEnabled) $underlying.debug($message, ..$args)"
172172
}
@@ -186,7 +186,7 @@ private object LoggerMacro {
186186
import c.universe._
187187
val underlying = q"${c.prefix}.underlying"
188188
if (args.length == 2)
189-
q"if ($underlying.isDebugEnabled) $underlying.debug($marker, $message, _root_.scala.List(${args(0)}, ${args(1)}): _*)"
189+
q"if ($underlying.isDebugEnabled) $underlying.debug($marker, $message, _root_.scala.Array(${args(0)}, ${args(1)}): _*)"
190190
else
191191
q"if ($underlying.isDebugEnabled) $underlying.debug($marker, $message, ..$args)"
192192
}
@@ -208,7 +208,7 @@ private object LoggerMacro {
208208
import c.universe._
209209
val underlying = q"${c.prefix}.underlying"
210210
if (args.length == 2)
211-
q"if ($underlying.isTraceEnabled) $underlying.trace($message, _root_.scala.List(${args(0)}, ${args(1)}): _*)"
211+
q"if ($underlying.isTraceEnabled) $underlying.trace($message, _root_.scala.Array(${args(0)}, ${args(1)}): _*)"
212212
else
213213
q"if ($underlying.isTraceEnabled) $underlying.trace($message, ..$args)"
214214
}
@@ -228,7 +228,7 @@ private object LoggerMacro {
228228
import c.universe._
229229
val underlying = q"${c.prefix}.underlying"
230230
if (args.length == 2)
231-
q"if ($underlying.isTraceEnabled) $underlying.trace($marker, $message, _root_.scala.List(${args(0)}, ${args(1)}): _*)"
231+
q"if ($underlying.isTraceEnabled) $underlying.trace($marker, $message, _root_.scala.Array(${args(0)}, ${args(1)}): _*)"
232232
else
233233
q"if ($underlying.isTraceEnabled) $underlying.trace($marker, $message, ..$args)"
234234
}

0 commit comments

Comments
 (0)