Java Utililty Methods Log Message

List of utility methods to do Log Message

Description

The list of methods to do Log Message are organized into topic(s).

Method

voidlogMsg(String msg)
log Msg
try {
    if (out == null)
        init();
} catch (Exception e) {
    e.printStackTrace();
out.println(msg);
out.flush();
...
voidLogMsg(String s)
Log Msg
PrintWriter out = null;
try {
    out = new PrintWriter(new BufferedWriter(new FileWriter("log.txt", true)));
    out.println(s);
} catch (IOException e) {
} finally {
    if (out != null) {
        out.close();
...
voidlogRawToConsole(String msg)
Writes a plain one-line text message to the console.
getOutStream().println(msg);
voidlogString(String logtext)
log String
File file = new File("outputs/log/log.txt");
BufferedWriter bw = null;
try {
    bw = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file, true)));
    bw.write(logtext + "\n");
    bw.flush();
} catch (Exception e) {
    e.printStackTrace();
...
voidlogThis(String id)
log This
try {
    BufferedWriter bfw = new BufferedWriter(new OutputStreamWriter(new FileOutputStream("tmp"), "utf-8"));
    bfw.write(id);
    bfw.close();
} catch (IOException e) {
    e.printStackTrace();