summaryrefslogtreecommitdiffstats
path: root/EssentialsGroupManager/src/org/anjocaido/groupmanager/utils/GMLoggerHandler.java
blob: 87b6806ab902e61dd3cfe0b43c477913a21b016f (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
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.anjocaido.groupmanager.utils;

import java.util.logging.ConsoleHandler;
import java.util.logging.Level;
import java.util.logging.LogRecord;

/**
 *
 * @author gabrielcouto
 */
public class GMLoggerHandler extends ConsoleHandler {

    @Override
    public void publish(LogRecord record) {
        String message = "GroupManager - " + record.getLevel() + " - " + record.getMessage();
        if (record.getLevel().equals(Level.SEVERE) || record.getLevel().equals(Level.WARNING)) {
            System.err.println(message);
        } else {
            System.out.println(message);
        }
    }
}