Android Open Source - AGOGCyberStat Repository






From Project

Back to project page AGOGCyberStat.

License

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.

Java Source Code

package me.allenz.androidapplog;
//from  w w  w .  j  a v a2 s.c o  m
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class Repository {

    private LoggerConfig rootLoggerConfig;

    private Map<String, LoggerConfig> loggerConfigs;

    private Map<String, Logger> loggers;

    private List<Appender> appenders;

    public Repository(){
        loggerConfigs = new HashMap<String, LoggerConfig>();
        loggers = new HashMap<String, Logger>();
        appenders = new ArrayList<Appender>();
    }

    public Repository(final Configure configure){
        this();
        setConfigure(configure);
    }

    public void setConfigure(final Configure configure) {
        clear();
        configure.applyConfigure(this);
        startAppenders();
    }

    private void clear() {
        rootLoggerConfig = null;
        loggerConfigs.clear();
        loggers.clear();
        for (final Appender appender: appenders) {
            appender.stop();
        }
        appenders.clear();
    }

    private void startAppenders() {
        for (final Appender appender: appenders) {
            appender.start();
        }
    }

    public LoggerConfig getRootLoggerConfig() {
        return rootLoggerConfig;
    }

    public void setRootLoggerConfig(final LoggerConfig loggerConfig) {
        this.rootLoggerConfig = loggerConfig;
    }

    public LoggerConfig getLoggerConfig(final String name) {
        return loggerConfigs.get(name);
    }

    public void addLoggerConfig(final LoggerConfig loggerConfig) {
        loggerConfigs.put(loggerConfig.getName(), loggerConfig);
    }

    public Logger getLogger(final String name) {
        return loggers.get(name);
    }

    public void addLogger(final String name, final Logger logger) {
        loggers.put(name, logger);
    }

    public List<Appender> getAppenders() {
        return appenders;
    }

    public void addAppender(final Appender appender) {
        appenders.add(appender);
    }

}




Java Source Code List

com.agog.cyberstat.BrR.java
com.agog.cyberstat.JSONSettings.java
com.agog.cyberstat.MainActivity.java
com.agog.cyberstat.MotisonNetTask.java
com.agog.cyberstat.MotisonXML.java
com.agog.cyberstat.MyPrefs.java
com.agog.cyberstat.NetR.java
com.agog.cyberstat.Trigger.java
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