private Log __tryGetLogSafely() { if (__simplog == null) { __simplog = new SimpleLog(__loggerName); } return __simplog; }
/** * 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"); } return this.logger; }
private Log __tryGetLogSafely() { if (__simplog == null) { __simplog = new SimpleLog(__loggerName); } return __simplog; }
public static Log getDelegate(final String name) { // If no factory is set, then use a SimpleLog... so logging always works if (factory == null) { return new SimpleLog(name); } try { return (Log) factory.newInstance(new Object[] { name }); } catch (Exception e) { throw new RuntimeException("Failed to construct delegate logger using factory: " + factory, e); } }
public static Log getDelegate(final String name) { // If no factory is set, then use a SimpleLog... so logging always works if (factory == null) { return new SimpleLog(name); } try { return (Log) factory.newInstance(new Object[] { name }); } catch (Exception e) { throw new RuntimeException("Failed to construct delegate logger using factory: " + factory, e); } }
/** * Construct a new TestConverter */ public TestConverter() { logger = new SimpleLog("FOP/Test"); logger.setLevel(SimpleLog.LOG_LEVEL_ERROR); }
private static Log getLog() { SimpleLog log = new SimpleLog("cocoon.deprecation"); log.setLevel(SimpleLog.LOG_LEVEL_ALL); return log; }
System.out.println(SomeClass.someMethod(null, null, 7L, new SimpleLog("simplelog")));
/** * {@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); } }
public void run() { if (fail.get()){ latch.countDown(); return; } MailboxSession session = getMailboxManager().createSystemSession("test", new SimpleLog("Test")); try { getMailboxManager().startProcessingRequest(session); MessageManager m = getMailboxManager().getMailbox(path, session); System.out.println("Append message with uid=" + m.appendMessage(new ByteArrayInputStream("Subject: test\r\n\r\ntestmail".getBytes()), new Date(), session, false, new Flags())); getMailboxManager().endProcessingRequest(session); getMailboxManager().logout(session,false); } catch (MailboxException e) { e.printStackTrace(); fail.set(true); } finally { latch.countDown(); } } });
final ExecutorService pool = Executors.newFixedThreadPool(APPEND_OPERATIONS/2); MailboxSession session = getMailboxManager().createSystemSession("test", new SimpleLog("Test")); getMailboxManager().startProcessingRequest(session); final MailboxPath path = new MailboxPath(MailboxConstants.USER_NAMESPACE, "username", "INBOX"); MailboxSession session = getMailboxManager().createSystemSession("test", new SimpleLog("Test"));