Back to project page AGOGCyberStat.
The source code is released under:
MIT License
If you think the Android project AGOGCyberStat listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package me.allenz.androidapplog; /* www .j a va 2 s . c om*/ public abstract class AbstractAppender implements Appender { private static final Logger internalLogger = LoggerFactory.getInternalLogger(); protected boolean started; @Override public void start() { if (!started) { started = doStart(); if (started) { internalLogger.verbose("%s is started", this.getClass().getSimpleName()); } else { internalLogger.verbose("can not start %s", this.getClass().getSimpleName()); } } } @Override public boolean isStarted() { return started; } @Override public void stop() { if (started) { started = !doStop(); if (!started) { internalLogger.verbose("%s is stop", this.getClass().getSimpleName()); } else { internalLogger.verbose("can not stop %s", this.getClass().getSimpleName()); } } } @Override public void append(final LogEvent event) { if (isStarted()) { doAppend(event); } } protected abstract boolean doStart(); protected abstract boolean doStop(); protected abstract void doAppend(LogEvent event); }