01: package org.apache.maven.embedder;/*
02: * Licensed to the Apache Software Foundation (ASF) under one
03: * or more contributor license agreements. See the NOTICE file
04: * distributed with this work for additional information
05: * regarding copyright ownership. The ASF licenses this file
06: * to you under the Apache License, Version 2.0 (the
07: * "License"); you may not use this file except in compliance
08: * with the License. You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing,
13: * software distributed under the License is distributed on an
14: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15: * KIND, either express or implied. See the License for the
16: * specific language governing permissions and limitations
17: * under the License.
18: */
19:
20: /**
21: * Logger sending everything to the standard output streams.
22: * This is mainly for the cases when you have a utility that
23: * does not have a logger to supply.
24: *
25: * @author <a href="mailto:dev@avalon.codehaus.org">Avalon Development Team</a>
26: * @version $Id: MavenEmbedderConsoleLogger.java 572408 2007-09-03 19:33:10Z jvanzyl $
27: */
28: public final class MavenEmbedderConsoleLogger extends
29: AbstractMavenEmbedderLogger {
30: public void debug(String message, Throwable throwable) {
31: if (isDebugEnabled()) {
32: System.out.print("[DEBUG] ");
33: System.out.println(message);
34:
35: if (null != throwable) {
36: throwable.printStackTrace(System.out);
37: }
38: }
39: }
40:
41: public void info(String message, Throwable throwable) {
42: if (isInfoEnabled()) {
43: System.out.print("[INFO] ");
44: System.out.println(message);
45:
46: if (null != throwable) {
47: throwable.printStackTrace(System.out);
48: }
49: }
50: }
51:
52: public void warn(String message, Throwable throwable) {
53: if (isWarnEnabled()) {
54: System.out.print("[WARNING] ");
55: System.out.println(message);
56:
57: if (null != throwable) {
58: throwable.printStackTrace(System.out);
59: }
60: }
61: }
62:
63: public void error(String message, Throwable throwable) {
64: if (isErrorEnabled()) {
65: System.out.print("[ERROR] ");
66: System.out.println(message);
67:
68: if (null != throwable) {
69: throwable.printStackTrace(System.out);
70: }
71: }
72: }
73:
74: public void fatalError(String message, Throwable throwable) {
75: if (isFatalErrorEnabled()) {
76: System.out.print("[ERROR] ");
77: System.out.println(message);
78:
79: if (null != throwable) {
80: throwable.printStackTrace(System.out);
81: }
82: }
83: }
84:
85: public void close() {
86: }
87: }
|