universe@247: /* universe@247: * Copyright 2021 Mike Becker. All rights reserved. universe@247: * universe@247: * Redistribution and use in source and binary forms, with or without universe@247: * modification, are permitted provided that the following conditions are met: universe@247: * universe@247: * 1. Redistributions of source code must retain the above copyright universe@247: * notice, this list of conditions and the following disclaimer. universe@247: * universe@247: * 2. Redistributions in binary form must reproduce the above copyright universe@247: * notice, this list of conditions and the following disclaimer in the universe@247: * documentation and/or other materials provided with the distribution. universe@247: * universe@247: * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" universe@247: * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE universe@247: * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE universe@247: * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE universe@247: * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL universe@247: * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR universe@247: * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER universe@247: * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, universe@247: * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE universe@247: * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. universe@247: */ universe@247: universe@247: package de.uapcore.lightpit universe@247: universe@247: import java.util.logging.Level universe@247: import java.util.logging.Logger universe@247: universe@247: class MyLogger { universe@247: private val logger: Logger = Logger.getLogger("de.uapcore.lightpit.Logger") universe@247: universe@247: fun info(fmt: String, vararg args: Any?) { universe@247: logger.log(Level.INFO, fmt, args) universe@247: } universe@247: fun debug(fmt: String, vararg args: Any?) { universe@247: logger.log(Level.FINE, fmt, args) universe@247: } universe@247: fun warn(fmt: String, vararg args: Any?) { universe@247: logger.log(Level.WARNING, fmt, args) universe@247: } universe@247: fun error(fmt: String, vararg args: Any?) { universe@247: logger.log(Level.SEVERE, fmt, args) universe@247: } universe@247: fun trace(fmt: String, vararg args: Any?) { universe@247: logger.log(Level.FINEST, fmt, args) universe@247: } universe@247: universe@247: fun info(msg: String, ex: Throwable) { universe@247: logger.log(Level.INFO, msg, ex) universe@247: } universe@247: fun debug(msg: String, ex: Throwable) { universe@247: logger.log(Level.FINE, msg, ex) universe@247: } universe@247: fun warn(msg: String, ex: Throwable) { universe@247: logger.log(Level.WARNING, msg, ex) universe@247: } universe@247: fun error(msg: String, ex: Throwable) { universe@247: logger.log(Level.SEVERE, msg, ex) universe@247: } universe@247: fun trace(msg: String, ex: Throwable) { universe@247: logger.log(Level.FINEST, msg, ex) universe@247: } universe@247: }