Question

Google's Closure Compiler has this flag for logging:

--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.

But how do I enable logging, and where is the log file?

Was it helpful?

Solution

Create a file called logging.properties with the following contents:

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 -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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top