/** * {@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); } }
/** * 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; }
/** * 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); } }
protected void setUp() throws Exception { super.setUp(); originalLogFactoryAttribute = (String) LogFactory.getFactory().getAttribute(LogFactoryImpl.LOG_PROPERTY); LogFactory.getFactory().setAttribute(LogFactoryImpl.LOG_PROPERTY, SimpleLog.class.getName()); }
/** * Construct a new TestConverter */ public TestConverter() { logger = new SimpleLog("FOP/Test"); logger.setLevel(SimpleLog.LOG_LEVEL_ERROR); }