diff --git a/.travis.yml b/.travis.yml index 3287be692..ce5390a3a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,8 +2,8 @@ language: scala jdk: oraclejdk8 scala: - - 2.11.11 - - 2.12.3 + - 2.11.12 + - 2.12.4 script: - sbt -Dfile.encoding=UTF8 -J-XX:ReservedCodeCacheSize=256M "++$TRAVIS_SCALA_VERSION" mimaReportBinaryIssues scalafmt::test test:scalafmt::test test diff --git a/internal/util-logging/src/main/scala/sbt/util/LogExchange.scala b/internal/util-logging/src/main/scala/sbt/util/LogExchange.scala index 0c35c98ee..b5bb1cb56 100644 --- a/internal/util-logging/src/main/scala/sbt/util/LogExchange.scala +++ b/internal/util-logging/src/main/scala/sbt/util/LogExchange.scala @@ -31,7 +31,9 @@ sealed abstract class LogExchange { false, XLevel.DEBUG, name, - "true", + // disable the calculation of caller location as it is very expensive + // https://issues.apache.org/jira/browse/LOG4J2-153 + "false", Array[AppenderRef](), null, config, diff --git a/internal/util-logging/src/test/scala/ManagedLoggerSpec.scala b/internal/util-logging/src/test/scala/ManagedLoggerSpec.scala index 8e9c905e1..56742b836 100644 --- a/internal/util-logging/src/test/scala/ManagedLoggerSpec.scala +++ b/internal/util-logging/src/test/scala/ManagedLoggerSpec.scala @@ -20,6 +20,18 @@ class ManagedLoggerSpec extends FlatSpec with Matchers { log.infoEvent(1) } + it should "validate performance improvement of disabling location calculation for async loggers" in { + val log = LogExchange.logger("foo") + LogExchange.bindLoggerAppenders("foo", List(LogExchange.asyncStdout -> Level.Info)) + val before = System.currentTimeMillis() + 1 to 10000 foreach { _ => + log.debug("test") + } + val after = System.currentTimeMillis() + + log.info(s"Peformance test took: ${after - before}ms") + } + it should "support logging Throwable out of the box" in { import sbt.internal.util.codec.JsonProtocol._ val log = LogExchange.logger("foo") diff --git a/project/Dependencies.scala b/project/Dependencies.scala index 6cc640ddf..439ff5650 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -3,11 +3,11 @@ import Keys._ import sbt.contraband.ContrabandPlugin.autoImport._ object Dependencies { - val scala210 = "2.10.6" - val scala211 = "2.11.11" - val scala212 = "2.12.3" + val scala210 = "2.10.7" + val scala211 = "2.11.12" + val scala212 = "2.12.4" - private val ioVersion = "1.0.0" + private val ioVersion = "1.1.1" private val sbtIO = "org.scala-sbt" %% "io" % ioVersion diff --git a/project/plugins.sbt b/project/plugins.sbt index aa8c8024a..81ebe9957 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,4 +1,4 @@ addSbtPlugin("org.scala-sbt" % "sbt-houserules" % "0.3.3") addSbtPlugin("org.scala-sbt" % "sbt-contraband" % "0.3.0") addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "0.1.17") -addSbtPlugin("com.lucidchart" % "sbt-scalafmt" % "1.10") +addSbtPlugin("com.lucidchart" % "sbt-scalafmt" % "1.14")