View Javadoc

1   /**
2    * Copyright (C) 2010-2012 Joerg Bellmann <joerg.bellmann@googlemail.com>
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *         http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package com.googlecode.t7mp;
17  
18  /**
19   * TODO Comment.
20   * @author Joerg Bellmann
21   *
22   */
23  public class DefaultPluginLog implements PluginLog {
24  
25      @Override
26      public void debug(CharSequence message) {
27          System.err.println(formatMessage(message));
28      }
29  
30      @Override
31      public void debug(Throwable cause) {
32          cause.printStackTrace();
33      }
34  
35      @Override
36      public void debug(CharSequence message, Throwable cause) {
37          System.err.println(formatMessage(message));
38          cause.printStackTrace();
39      }
40  
41      @Override
42      public String formatMessage(CharSequence message) {
43          return message.toString();
44      }
45  
46      @Override
47      public void error(CharSequence message) {
48          System.err.println(formatMessage(message));
49      }
50  
51      @Override
52      public void error(Throwable cause) {
53          cause.printStackTrace();
54      }
55  
56      @Override
57      public void error(CharSequence message, Throwable cause) {
58          System.err.println(formatMessage(message));
59          cause.printStackTrace();
60      }
61  
62      @Override
63      public void info(CharSequence message) {
64          System.err.println(formatMessage(message));
65      }
66  
67      @Override
68      public void info(Throwable cause) {
69          cause.printStackTrace();
70      }
71  
72      @Override
73      public void info(CharSequence message, Throwable cause) {
74          System.err.println(formatMessage(message));
75          cause.printStackTrace();
76      }
77  
78      @Override
79      public boolean isDebugEnabled() {
80          return false;
81      }
82  
83      @Override
84      public boolean isErrorEnabled() {
85          return false;
86      }
87  
88      @Override
89      public boolean isInfoEnabled() {
90          return true;
91      }
92  
93      @Override
94      public boolean isWarnEnabled() {
95          return false;
96      }
97  
98      @Override
99      public void warn(CharSequence message) {
100         System.err.println(formatMessage(message));
101     }
102 
103     @Override
104     public void warn(Throwable cause) {
105         cause.printStackTrace();
106     }
107 
108     @Override
109     public void warn(CharSequence message, Throwable cause) {
110         System.err.println(formatMessage(message));
111         cause.printStackTrace();
112     }
113 
114 }