[英]How do I enable logging for Google Closure Compiler?
Google's Closure Compiler has this flag for logging: Google的Closure Compiler有一个用于记录的标志:
--logging_level VAL
The logging level (standard java.util.logging.Level values)
for Compiler progress. Does not control errors or warnings
for the JavaScript code under compilation.
So I can set the logging level to one of: SEVERE
, WARNING
, INFO
, CONFIG
, FINE
, FINER
, FINEST
. 因此,我可以将日志记录级别设置为之一: SEVERE
, WARNING
, INFO
, CONFIG
, FINE
, FINER
, FINEST
。
But how do I enable logging, and where is the log file? 但是如何启用日志记录,日志文件在哪里?
Create a file called logging.properties
with the following contents: 使用以下内容创建名为logging.properties
的文件:
handlers = java.util.logging.FileHandler
java.util.logging.FileHandler.pattern = closure-compiler.log
java.util.logging.FileHandler.formatter = java.util.logging.SimpleFormatter
Then set the java.util.logging.config.file
Java system property to logging.properties
when running the application: 然后在运行应用程序时将java.util.logging.config.file
Java系统属性设置为logging.properties
:
java -Djava.util.logging.config.file=logging.properties \
-jar compiler.jar \
--js script.js \
--logging_level FINEST
The log will be written to closure-compiler.log
. 该日志将写入closure-compiler.log
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.