@Override public void log(String msg) { if (log != null) log.t(msg); }
@Override public void log(LEVEL level, Object ... msg) { for (Log target : targets) target.log(level, msg); }
public void log(Log log) { log.w(id,"Connection",this); MLogUtil.logStackTrace(log, ""+id, stackTrace); }
public static void logStackTrace(Log log, String prefix, StackTraceElement[] stackTrace) { for (StackTraceElement element : stackTrace) { log.w(prefix," " + element); } }
@Override public void updateLog() { if (mlogFactory == null) return; mlogFactory.update(); }
/** {@inheritDoc} */ @Override public boolean isLevelEnabled(LEVEL level) { return targets[0].isLevelEnabled(level); }
@Override public void close() { for (Log target : targets) target.close(); }
public StreamToLogAdapter(LEVEL level, PrintStream forward) { super(new MyOutputStream()); this.level = level; this.forward = forward; ((MyOutputStream)out).setAdapter(this); }
@Override public synchronized void write(int b) throws IOException { if (adapter == null) return; adapter.writeByte(b); }
public void close() { if (engine == null) return; // unregister(); engine.close(); engine = null; }
public PrintWriterTaskContext(PrintWriterLog log, IConfig config, boolean testOnly) { this.log = log; this.writer = log.getWriter(); this.config = config; this.testOnly = testOnly; }
public PrintWriterTaskContext(String name, PrintWriter writer, IConfig config, boolean testOnly) { log = new PrintWriterLog(name, writer); this.writer = writer; this.config = config; this.testOnly = testOnly; }
/** * Log a message in trace, it will automatically append the objects if trace is enabled. Can Also add a trace. * This is the local trace method. The trace will only written if the local trace is switched on. * @param msg */ public void t(Object ... msg) { log(LEVEL.TRACE, msg); }
/** * Log a message in debug, it will automatically append the objects if debug is enabled. Can Also add a trace. * @param msg */ public void d(Object ... msg) { log(LEVEL.DEBUG, msg); }