/*
 * Copyright 2012 Anton Tananaev (anton.tananaev@gmail.com)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.traccar.helper;

import java.util.logging.Logger;

/**
 * Logger
 */
public class Log {

    /**
     * Return global logger
     */
    public static Logger getLogger() {
        return Logger.getLogger(Logger.GLOBAL_LOGGER_NAME);
    }

    public static void severe(String msg) {
        getLogger().severe(msg);
    }

    public static void warning(String msg) {
        getLogger().warning(msg);
    }

    public static void info(String msg) {
        getLogger().info(msg);
    }

    public static void fine(String msg) {
        getLogger().fine(msg);
    }

}

@@ -647,16 +647,48 @@
 elper;%0A%0A
+import java.util.logging.Level;%0A
 import j
@@ -712,16 +712,16 @@
 Logger;%0A
-
 %0A/**%0A * 
@@ -891,32 +891,386 @@
 GER_NAME);%0A    %7D
+%0A    %0A    private static void write(Level level, String msg) %7B%0A        StackTraceElement%5B%5D stack = Thread.currentThread().getStackTrace();%0A        if (stack != null && stack.length %3E 3) %7B%0A            getLogger().logp(level, stack%5B3%5D.getClassName(), stack%5B3%5D.getMethodName(), msg);%0A        %7D else %7B%0A            getLogger().log(level, msg);%0A        %7D%0A    %7D
 %0A%0A    public sta
@@ -1311,27 +1311,28 @@
     
-getLogger().severe(
+write(Level.SEVERE, 
 msg)
@@ -1397,28 +1397,29 @@
     
-getLogger().warning(
+write(Level.WARNING, 
 msg)
@@ -1481,25 +1481,26 @@
     
-getLogger().info(
+write(Level.INFO, 
 msg)
@@ -1562,25 +1562,26 @@
     
-getLogger().fine(
+write(Level.FINE, 
 msg)

Improve logging methods