Here you can find the source of LogMsg(String s)
public static void LogMsg(String s)
//package com.java2s; // LICENSE: This file is distributed under the BSD license. import java.io.BufferedWriter; import java.io.FileWriter; import java.io.IOException; import java.io.PrintWriter; public class Main { public static void LogMsg(String s) { PrintWriter out = null;//from w w w.j a v a 2 s .c o m try { out = new PrintWriter(new BufferedWriter(new FileWriter( "log.txt", true))); out.println(s); } catch (IOException e) { } finally { if (out != null) { out.close(); } } } }