comparison src/org/tn5250j/tools/logging/TN5250jLogger.java @ 5:cbdff98c45ea tn5250

adding tn5250 files
author Carl Byington <carl@five-ten-sg.com>
date Thu, 22 May 2014 12:38:09 -0700
parents
children
comparison
equal deleted inserted replaced
4:1f5d9b76a183 5:cbdff98c45ea
1 /*
2 * @(#)TN5250jLogger.java
3 * @author Kenneth J. Pouncey
4 *
5 * Copyright: Copyright (c) 2001, 2002, 2003
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2, or (at your option)
10 * any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this software; see the file COPYING. If not, write to
19 * the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
20 * Boston, MA 02111-1307 USA
21 *
22 */
23 package org.tn5250j.tools.logging;
24
25 /**
26 * An interface defining generic loggers.
27 */
28 public interface TN5250jLogger {
29
30 // debug levels - The levels work from lower to higher. The lower levels
31 // will be activated by turning on a higher level
32 public static final int DEBUG = 1; // most verbose
33 public static final int INFO = 2;
34 public static final int WARN = 4; // medium verbose, should be choosen for deployment
35 public static final int ERROR = 8;
36 public static final int FATAL = 16;
37 public static final int OFF = 32; // most silence
38
39 /**
40 * @param clazz
41 */
42 abstract public void initialize(final String clazz);
43
44 /**
45 * @param message
46 */
47 abstract public void debug(Object message);
48
49 /**
50 * @param message
51 * @param throwable
52 */
53 abstract public void debug(Object message, Throwable throwable);
54
55 abstract public void info(Object message);
56
57 /**
58 * @param message
59 * @param throwable
60 */
61 abstract public void info(Object message, Throwable throwable);
62
63 /**
64 * @param message
65 */
66 abstract public void warn(Object message);
67
68 /**
69 * @param message
70 * @param throwable
71 */
72 abstract public void warn(Object message, Throwable throwable);
73
74 /**
75 * @param message
76 */
77 abstract public void error(Object message);
78
79 /**
80 * @param message
81 * @param throwable
82 */
83 abstract public void error(Object message, Throwable throwable);
84
85 /**
86 * @param message
87 */
88 abstract public void fatal(Object message);
89
90 /**
91 * @param message
92 * @param throwable
93 */
94 abstract public void fatal(Object message, Throwable throwable);
95
96 /**
97 * @return
98 */
99 abstract public boolean isDebugEnabled();
100
101 /**
102 * @return
103 */
104 abstract public boolean isInfoEnabled();
105
106 /**
107 * @return
108 */
109 abstract public boolean isWarnEnabled();
110
111 /**
112 * @return
113 */
114 abstract public boolean isErrorEnabled();
115
116 /**
117 * @return
118 */
119 abstract public boolean isFatalEnabled();
120
121 /**
122 * Sets a new log level.
123 * @param newLevel
124 * @throws IllegalArgumentException If the new level is not allowed
125 */
126 abstract public void setLevel(int newLevel);
127
128 /**
129 * @return The current log level.
130 */
131 abstract public int getLevel();
132
133 }