Having the following code: log.info ("parameters {} and {}", param1, param2) compiles and works well with SLF4J in Scala
However, if I want to pass more arguments, I need to use Array:
log.info("parameters {} and {} and {}", Array(param1, param2,param3))
which simply replaces the first parameter with array.toString and leaves the rest of the parameters unconnected.
Following code
log.info("parameters {} and {} and {}", Array(param1, param2,param3) : _*)
not compiled due to:
error: overloaded method value info with alternatives: (org.slf4j.Marker,java.lang.String)Unit <and> (java.lang.String,java.lang.Throwable)Unit <and> (java.lang.String,Array[java.lang.Object])Unit <and> (java.lang.String,Any)Unit cannot be applied to (java.lang.String, Any) log.info("parameters {} and {} and {}", Array(param1, param2,param3) : _*)
What am I missing here?
source share