Android Log writeLog(String msg)

Here you can find the source of writeLog(String msg)

Description

write Log

Declaration

public static void writeLog(String msg) 

Method Source Code

//package com.java2s;

import java.io.BufferedWriter;
import java.io.File;

import java.io.FileWriter;

public class Main {
    public static File logFile;

    public static void writeLog(String msg) {
        try {//www . j a v a2s . co m
            // if file doesnt exists, then create it
            if (!logFile.exists()) {
                logFile.createNewFile();
            }

            FileWriter fw = new FileWriter(logFile.getAbsoluteFile(), true);
            BufferedWriter bw = new BufferedWriter(fw);
            bw.write(msg);
            bw.close();
        } catch (Exception e) {
        }
    }
}

Related

  1. LogE(String tag, String message)
  2. debug(Object msg)
  3. debug(Object msg, Object msg2)
  4. debug(Throwable e)
  5. debugLsDir(String dir)