Android Open Source - ILog Text File Logger






From Project

Back to project page ILog.

License

The source code is released under:

GNU General Public License

If you think the Android project ILog 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 com.moshx.ilog.filelogger;
//www  . ja v  a2s  .c o  m
import java.util.Locale;

import com.moshx.ilog.Settings.Level;
import com.moshx.ilog.utils.Utility;

public class TextFileLogger extends FileLogger {

  String logFormat = "[%s]   -%s   %s   %s\n";

  @Override
  public boolean log(Level level, String tag, Object msg, Throwable err) {
    if (printStream == null) {
      return false;
    }

    String result = String.format(Locale.US, logFormat, Utility
        .getFormattedDate(), level.toString(), tag,
        msg != null ? msg.toString() : "");
    printStream.append(result);
    if (err != null) {
      err.printStackTrace(printStream);
    }
    return true;
  }

}




Java Source Code List

com.moshx.ilog.ILog.java
com.moshx.ilog.Settings.java
com.moshx.ilog.console.AndroidConsole.java
com.moshx.ilog.console.ConsoleFactory.java
com.moshx.ilog.console.ILogConsole.java
com.moshx.ilog.console.JVMConsole.java
com.moshx.ilog.filelogger.FileLogger.java
com.moshx.ilog.filelogger.HtmlFileLogger.java
com.moshx.ilog.filelogger.TextFileLogger.java
com.moshx.ilog.utils.Utility.java
com.moshx.ilogsample.MainActivity.java
com.moshx.jvmsample.LoggingTest.java