All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.beigesoft.alog.LoggerStandard Maven / Gradle / Ivy

Go to download

A-Jetty Base can run on Android Java as well as on standard Java 7+ and it can run precompiled JSP/JSTL.

There is a newer version: 1.0.5
Show newest version
package org.beigesoft.alog;

/*
 * Beigesoft ™
 *
 * Licensed under the Apache License, Version 2.0
 *
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 */

import java.util.logging.Logger;
import java.util.logging.Level;

/**
 * 

Implementation of Logger adapter with java.util.logging. * This logger used in already preconfigured container e.g. Tomcat.

* * @author Yury Demidenko */ public class LoggerStandard implements ILogger { /** *

logger.

**/ private Logger logger = Logger.getAnonymousLogger(); /** *

Is show debug messages.

**/ private boolean isShowDebugMessage; /** *

Make debug log.

* @param pClazz of debudgged bean * @param pMsg message **/ @Override public final void debug(final Class pClazz, final String pMsg) { if (this.isShowDebugMessage) { logger.log(Level.INFO, pClazz.getSimpleName() + ": " + pMsg); } } /** *

Make info log.

* @param pClazz of bean * @param pMsg message **/ @Override public final void info(final Class pClazz, final String pMsg) { logger.log(Level.INFO, pClazz.getSimpleName() + ": " + pMsg); } /** *

Make error log.

* @param pClazz of bean * @param pMsg message **/ @Override public final void error(final Class pClazz, final String pMsg) { logger.log(Level.SEVERE, pClazz.getSimpleName() + ": " + pMsg); } /** *

Make warn log.

* @param pClazz of bean * @param pMsg message **/ @Override public final void warn(final Class pClazz, final String pMsg) { logger.log(Level.WARNING, pClazz.getSimpleName() + ": " + pMsg); } /** *

Set is show debug messages.

* @param pIsShowDebugMessage is show debug messages? **/ @Override public final void setIsShowDebugMessages( final boolean pIsShowDebugMessage) { this.isShowDebugMessage = pIsShowDebugMessage; } /** *

Get is show debug messages.

* @return is show debug messages? **/ @Override public final boolean getIsShowDebugMessages() { return this.isShowDebugMessage; } //Simple getters and setters: /** *

Geter for logger.

* @return Logger **/ public final Logger getLogger() { return this.logger; } /** *

Setter for logger.

* @param pLogger reference **/ public final void setLogger(final Logger pLogger) { this.logger = pLogger; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy