001: package org.apache.maven.monitor.logging;
002:
003: /*
004: * Licensed to the Apache Software Foundation (ASF) under one
005: * or more contributor license agreements. See the NOTICE file
006: * distributed with this work for additional information
007: * regarding copyright ownership. The ASF licenses this file
008: * to you under the Apache License, Version 2.0 (the
009: * "License"); you may not use this file except in compliance
010: * with the License. You may obtain a copy of the License at
011: *
012: * http://www.apache.org/licenses/LICENSE-2.0
013: *
014: * Unless required by applicable law or agreed to in writing,
015: * software distributed under the License is distributed on an
016: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
017: * KIND, either express or implied. See the License for the
018: * specific language governing permissions and limitations
019: * under the License.
020: */
021:
022: import org.apache.maven.plugin.logging.Log;
023: import org.codehaus.plexus.logging.Logger;
024:
025: /**
026: * @author jdcasey
027: */
028: public class DefaultLog implements Log {
029:
030: private final Logger logger;
031:
032: public DefaultLog(Logger logger) {
033: this .logger = logger;
034: }
035:
036: public void debug(CharSequence content) {
037: logger.debug(toString(content));
038: }
039:
040: private String toString(CharSequence content) {
041: if (content == null) {
042: return "";
043: } else {
044: return content.toString();
045: }
046: }
047:
048: public void debug(CharSequence content, Throwable error) {
049: logger.debug(toString(content), error);
050: }
051:
052: public void debug(Throwable error) {
053: logger.debug("", error);
054: }
055:
056: public void info(CharSequence content) {
057: logger.info(toString(content));
058: }
059:
060: public void info(CharSequence content, Throwable error) {
061: logger.info(toString(content), error);
062: }
063:
064: public void info(Throwable error) {
065: logger.info("", error);
066: }
067:
068: public void warn(CharSequence content) {
069: logger.warn(toString(content));
070: }
071:
072: public void warn(CharSequence content, Throwable error) {
073: logger.warn(toString(content), error);
074: }
075:
076: public void warn(Throwable error) {
077: logger.warn("", error);
078: }
079:
080: public void error(CharSequence content) {
081: logger.error(toString(content));
082: }
083:
084: public void error(CharSequence content, Throwable error) {
085: logger.error(toString(content), error);
086: }
087:
088: public void error(Throwable error) {
089: logger.error("", error);
090: }
091:
092: public boolean isDebugEnabled() {
093: return logger.isDebugEnabled();
094: }
095:
096: public boolean isInfoEnabled() {
097: return logger.isInfoEnabled();
098: }
099:
100: public boolean isWarnEnabled() {
101: return logger.isWarnEnabled();
102: }
103:
104: public boolean isErrorEnabled() {
105: return logger.isErrorEnabled();
106: }
107:
108: }
|