Android Open Source - AndroidAppLog Log Event






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;
//  www  .j a  v  a 2 s. co  m
import java.text.SimpleDateFormat;
import java.util.Date;

public class LogEvent {

  private static final String DELIMITER = "    ";

  private static final String DATE_FORMAT = "yyyy-MM-dd HH:mm:ss.SSS";

  private long time;

  private LogLevel level;

  private String tag;

  private String message;

  public LogEvent(final LogLevel level, final String tag, final String message) {
    this(System.currentTimeMillis(), level, tag, message);
  }

  public LogEvent(final long millis, final LogLevel level, final String tag,
      final String message) {
    this.time = millis;
    this.level = level;
    this.tag = tag;
    this.message = message;
  }

  public long getTime() {
    return time;
  }

  public LogLevel getLevel() {
    return level;
  }

  public String getTag() {
    return tag;
  }

  public String getMessage() {
    return message;
  }

  @Override
  public String toString() {
    final SimpleDateFormat formatter = new SimpleDateFormat(DATE_FORMAT);
    final StringBuilder sb = new StringBuilder();
    sb.append(formatter.format(new Date(time))).append(DELIMITER);
    sb.append(level.toString()).append(DELIMITER);
    sb.append(tag).append(DELIMITER);
    sb.append(message);
    return sb.toString();
  }
}




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