blob: 62c9ab93db2cf7c0681472b7688bd4364f213c32 [file] [log] [blame]
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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.apache.openejb.util;
import org.apache.openejb.loader.Options;
import org.apache.openejb.loader.SystemInstance;
/**
* @version $Rev: 1182222 $ $Date: 2011-10-12 09:32:01 +0300 (Wed, 12 Oct 2011) $
*/
public class OptionsLog implements Options.Log {
private final Logger logger;
public OptionsLog() {
this(Logger.getInstance(LogCategory.OPENEJB.createChild("options"), OptionsLog.class));
}
public OptionsLog(final Logger logger) {
this.logger = logger;
}
public static void install() {
SystemInstance.get().getOptions().setLogger(new OptionsLog());
}
public boolean isDebugEnabled() {
return logger.isDebugEnabled();
}
public boolean isInfoEnabled() {
return logger.isInfoEnabled();
}
public boolean isWarningEnabled() {
return logger.isWarningEnabled();
}
public void debug(String message) {
logger.debug(message);
}
public void debug(String message, Throwable t) {
logger.debug(message, t);
}
public void info(String message) {
logger.info(message);
}
public void info(String message, Throwable t) {
logger.info(message, t);
}
public void warning(String message) {
logger.warning(message);
}
public void warning(String message, Throwable t) {
logger.warning(message, t);
}
}