简体   繁体   English

如何为Google Closure Compiler启用日志记录?

[英]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 . 因此,我可以将日志记录级别设置为之一: SEVEREWARNINGINFOCONFIGFINEFINERFINEST

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.

相关问题 Kafka:如何启用客户端日志记录? - Kafka: How do I enable client logging? 如何在Java 8中为异步类启用Android Studio / IDEA闭包折叠? - How do I enable Android Studio/IDEA closure folding for anomynous class in Java 8? Google Closure编译器Fuzzer配置 - Google Closure Compiler Fuzzer Config 如何在Google App Engine(Java)中启用会话支持? - How do I enable session support in Google App Engine (Java)? 如何通过命令行启用有关垃圾收集的详细信息的日志记录? - How do I enable logging of detailed information about garbage collection through the command line? log4j:如何在超类中为方法启用子类中的日志记录 - log4j: How do I enable logging in a subclass for a method in a superclass 使用log4j进行Spring Boot日志记录-如何启用Spring Boot日志条目? - Spring boot logging with log4j - how do I ENABLE spring boot log entries? 使用谷歌闭包编译器Java API - Using the google closure compiler Java API 通过 Java 将定义传递给 Google Closure Compiler - passing defines through Java to the Google Closure Compiler 命令行 Google Closure 提供的标准 extern 有哪些,如何通过 Java 接口获取? - What are the standard externs provided by the command line Google Closure, and how do I get them through the Java interface?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM