Relative performance impact of logging in Scala -


I have seen the following logging methods. What is the effect of the performance of each order? Are there any other benefits to using one on one another?

Val strValue = "xyz" val intValue = 200 log.debug ("this string" + strValue + "and int" + intValue "). Log string $ strValue and int $ IntValue ") log.debug (" This string will log in% s and int% d ".format (strValue, intValue)) log.debug (" This string will log {} and int {} ", strValue, intValue)

The requirements of my current logging are in play and akka projects.

I think there is no difference between display effects second and third approach Lkul should be identical. The second one is translated into the third person by the Scala compiler. The second one only provides a good syntax.

On being told that the performance of these log statements should not be affected at all. Those log statements are translated into the following, so it automatically follows the best practices that you know from Java.

  if (log .sebbugEnabled ()) {log.debug (...)}  

Finally: Most liked: -)


Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -