Java Log Message Log(String filename, String message)

Here you can find the source of Log(String filename, String message)

Description

Log

License

Open Source License

Declaration

public static void Log(String filename, String message) throws IOException 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.io.FileWriter;
import java.io.IOException;

public class Main {
    public static void Log(String filename, String message) throws IOException {
        QuickAppend(GetLog(filename), message + LF());
    }//from  w ww .  j a v a  2s.c o  m

    public static void QuickAppend(FileWriter f, String message) throws IOException {
        f.append(message);
        f.flush();
    }

    private static FileWriter GetLog(String filename) throws IOException {
        return new FileWriter(filename, true);
    }

    /**
     * Get the system's line endings
     * @return 
     */
    public static String LF() {
        return System.getProperty("line.separator");
    }
}

Related

  1. log(final String message, final String file)
  2. log(int physicalId, String message)
  3. log(Object o, String msg)
  4. LOG(Object... msgs)
  5. log(PrintWriter logger, String text)
  6. log(String fmt, Object... args)
  7. log(String line)
  8. log(String message)
  9. log(String message)