
org.lesscss.logging.JULILessLoggerProvider Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of lesscss Show documentation
Show all versions of lesscss Show documentation
Fork of official LESS CSS Compiler for Java with codepen.io imports
The newest version!
package org.lesscss.logging;
import java.util.logging.Level;
import java.util.logging.Logger;
class JULILessLoggerProvider implements LessLoggerProvider {
public LessLogger getLogger(Class> clazz) {
return new JULILessLogger(Logger.getLogger(clazz.getName()));
}
private static class JULILessLogger implements LessLogger {
private final Logger logger;
private JULILessLogger(Logger logger) {
this.logger = logger;
}
public boolean isDebugEnabled() {
return logger.isLoggable(Level.FINE);
}
public boolean isInfoEnabled() {
return logger.isLoggable(Level.INFO);
}
public void debug(String msg) {
logger.fine(msg);
}
public void debug(String format, Object... args) {
if( isDebugEnabled() ) {
logger.fine( String.format(format, args) );
}
}
public void info(String msg) {
logger.info(msg);
}
public void info(String format, Object... args) {
if( isInfoEnabled() ) {
logger.info(String.format(format,args));
}
}
public void error(String msg, Throwable t) {
logger.log(Level.SEVERE, msg, t);
}
public void error(String format, Object... args) {
logger.severe(String.format(format,args));
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy