Closed vhiairrassary closed 3 years ago
Logs are here using sbt 1.3.13
but not with sbt 1.4.6
.
The root cause is described in https://github.com/sbt/sbt/releases/tag/v1.4.0:
Replaces Apache Log4j with our own logger by default to avoid Appender leakage. Use ThisBuild / useLog4J := true to use Log4j.
Rational is available here: https://github.com/sbt/sbt/pull/5731. After using ThisBuild / useLog4J := true
then logs are available.
Would you rather:
ThisBuild / useLog4J := true
starting sbt 1.4.0
(with the associated memory leaks)?println
instead of logger.info
& logger.error
in scalajsbundler.util.Commands
?Also the decision may sit behind a setting but I think it is not a good idea to expose that for end users.
Anyway, I can prepare a PR for any solution (which would be a code change or a documentation change)
Whatever we do, we shouldn't use println
, since that is not configurable, and does not support last
.
👍 Here is a PoC using sbt global logger. I still need to validate the usage as there is not much documentation about the global logger.
Edit: following sbt repository recommendation, I posted the question on StackOverflow.
After
fastOptJS::startWebpackDevServer
succeeded I have no log from webpack-dev-server when recompiling.Replacing
logger
usages byprintln
fix the problem in: https://github.com/scalacenter/scalajs-bundler/blob/11cefe060fdcf689796f1e435100ad65525f26fd/sbt-scalajs-bundler/src/main/scala/scalajsbundler/util/Commands.scala#L44-L46I suspect sbt is "closing" the logger logger when the task is finished, while
fastOptJS::startWebpackDevServer
launches the devServer in a background progress. Any thoughts on the recommended fix? I am more than happy to work on it if neededMy configuration: