如何从命令行更改日志级别? [英] How to change log level from command line?

查看:48
本文介绍了如何从命令行更改日志级别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在不修改现有配置的情况下,在命令行更改 sbt 中的日志级别?

How can I change the log level in sbt at the command line without modifying the existing configuration?

推荐答案

全局更改 sbt 的日志级别:

要在启动时执行任何命令之前设置日志记录级别,使用 -- 在日志级别之前

To set the logging level before any commands are executed on startup, use -- before the logging level

有四个日志级别:

  • 调试
  • 信息
  • 警告
  • 错误

如果您需要在命令行中应用而不修改现有配置",请使用适当的级别并以双破折号为前缀执行 sbt 启动器.

If you need one applied "at the command line without modifying the existing configuration", execute the sbt launcher with appropriate level prefixed with double dashes.

jacek:~/oss/scalania
$ sbt --debug
[debug] > boot
[debug] > reload
[debug] > sbtStashOnFailure
[debug] > onFailure load-failed
[debug] > loadp
[info] Loading global plugins from /Users/jacek/.sbt/0.13/plugins
[debug] Running task... Cancelable: false, check cycles: false
[debug]

使用sbt.boot.properties,您也可以打印出sbt 内部日志.请参阅启动器规范.

With sbt.boot.properties you may get sbt internal logs printed out, too. See Launcher Specification.

这篇关于如何从命令行更改日志级别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆