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; /*from w ww . j av a2 s. c om*/ import java.text.SimpleDateFormat; import java.util.Date; public class LogEvent { private static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat( "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 StringBuilder sb = new StringBuilder(); sb.append(DATE_FORMAT.format(new Date(time))).append("\t"); sb.append(level.toString()).append("\t"); sb.append(tag).append("\t"); sb.append(message).append("\n"); return sb.toString(); } }