annotate src/org/tn5250j/tools/logging/TN5250jLogger.java @ 8:3b760b39962a tn5250

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