Java 类org.apache.commons.logging.impl.SimpleLog 实例源码

项目:fop    文件:Fop.java   
/**
 * {@inheritDoc}
 */
public void execute() throws BuildException {
    int logLevel = SimpleLog.LOG_LEVEL_INFO;
    switch (getMessageType()) {
        case Project.MSG_DEBUG  : logLevel = SimpleLog.LOG_LEVEL_DEBUG; break;
        case Project.MSG_INFO   : logLevel = SimpleLog.LOG_LEVEL_INFO; break;
        case Project.MSG_WARN   : logLevel = SimpleLog.LOG_LEVEL_WARN; break;
        case Project.MSG_ERR    : logLevel = SimpleLog.LOG_LEVEL_ERROR; break;
        case Project.MSG_VERBOSE: logLevel = SimpleLog.LOG_LEVEL_DEBUG; break;
        default: logLevel = SimpleLog.LOG_LEVEL_INFO;
    }
    SimpleLog logger = new SimpleLog("FOP/Anttask");
    logger.setLevel(logLevel);
    try {
        FOPTaskStarter starter = new FOPTaskStarter(this);
        starter.setLogger(logger);
        starter.run();
    } catch (FOPException ex) {
        throw new BuildException(ex);
    } catch (IOException ioe) {
        throw new BuildException(ioe);
    } catch (SAXException saxex) {
        throw new BuildException(saxex);
    }

}
项目:fop    文件:AbstractFOPTranscoder.java   
/**
 * Returns the logger associated with this transcoder. It returns a
 * SimpleLog if no logger has been explicitly set.
 * @return Logger the logger for the transcoder.
 */
protected final Log getLogger() {
    if (this.logger == null) {
        this.logger = new SimpleLog("FOP/Transcoder");
        ((SimpleLog) logger).setLevel(SimpleLog.LOG_LEVEL_INFO);
    }
    return this.logger;
}
项目:fop    文件:TestConverter.java   
/**
 * Controls whether to set logging to debug level
 * @param debug If true, debug level, if false, error level
 */
public void setDebug(boolean debug) {
    if (debug) {
        logger.setLevel(SimpleLog.LOG_LEVEL_DEBUG);
    } else {
        logger.setLevel(SimpleLog.LOG_LEVEL_ERROR);
    }
}
项目:perf4j    文件:CommonsLogStopWatchTest.java   
protected void setUp() throws Exception {
    super.setUp();

    originalLogFactoryAttribute = (String) LogFactory.getFactory().getAttribute(LogFactoryImpl.LOG_PROPERTY);
    LogFactory.getFactory().setAttribute(LogFactoryImpl.LOG_PROPERTY, SimpleLog.class.getName());
}
项目:fop    文件:TestConverter.java   
/**
 * Construct a new TestConverter
 */
public TestConverter() {
    logger = new SimpleLog("FOP/Test");
    logger.setLevel(SimpleLog.LOG_LEVEL_ERROR);
}