aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api/util/GT_Log.java
blob: 888f471317255211bb6fb8464236502d69156847 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package gregtech.api.util;

import java.io.File;
import java.io.OutputStream;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.List;

/**
 * NEVER INCLUDE THIS FILE IN YOUR MOD!!!
 * <p/>
 * Just a simple Logging Function. If on Server, then this will point to System.out and System.err
 */
public class GT_Log {
    public static PrintStream out = System.out;
    public static PrintStream err = System.err;
    public static PrintStream ore = new LogBuffer();
    public static PrintStream pal = null;
    public static PrintStream exp = new LogBuffer();
    public static File mLogFile;
    public static File mOreDictLogFile;
    public static File mPlayerActivityLogFile;
    public static File mExplosionLog;

    public static class LogBuffer extends PrintStream {
        public final List<String> mBufferedOreDictLog = new ArrayList<String>();

        public LogBuffer() {
            super(new OutputStream() {
                @Override
                public void write(int arg0) {/*Do nothing*/}
            });
        }

        @Override
        public void println(String aString) {
            mBufferedOreDictLog.add(aString);
        }
    }
}