Android Open Source - AndroidAppLog Abstract Appender






From Project

Back to project page AndroidAppLog.

License

The source code is released under:

Apache License

If you think the Android project AndroidAppLog listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package me.allenz.androidapplog;
//from w w w  .j  a va2 s. c  o  m
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);

}




Java Source Code List

me.allenz.androidapplog.AbstractAppender.java
me.allenz.androidapplog.AbstractLogger.java
me.allenz.androidapplog.AppenderSupportLogger.java
me.allenz.androidapplog.Appender.java
me.allenz.androidapplog.AsyncAppender.java
me.allenz.androidapplog.Configure.java
me.allenz.androidapplog.InternalLogger.java
me.allenz.androidapplog.LogCatAppender.java
me.allenz.androidapplog.LogEvent.java
me.allenz.androidapplog.LogLevel.java
me.allenz.androidapplog.LogTextView.java
me.allenz.androidapplog.LoggerConfig.java
me.allenz.androidapplog.LoggerFactory.java
me.allenz.androidapplog.Logger.java
me.allenz.androidapplog.PropertiesParser.java
me.allenz.androidapplog.ReflectUtils.java
me.allenz.androidapplog.Repository.java
me.allenz.androidapplog.RollingFileAppender.java
me.allenz.androidapplog.TextViewAppender.java
me.allenz.androidapplog.UncaughtExceptionLogger.java