Révision 1388
| tmp/org.txm.utils/src/org/txm/utils/logger/Log.java (revision 1388) | ||
|---|---|---|
| 40 | 40 |
|
| 41 | 41 |
import org.txm.utils.messages.UtilsCoreMessages; |
| 42 | 42 |
|
| 43 |
// TODO: Auto-generated Javadoc |
|
| 44 | 43 |
/** |
| 45 |
* The Class Log. |
|
| 44 |
* The Class Log contains methods to print messages in the console depending on a log level |
|
| 45 |
* |
|
| 46 |
* see the severe(), warning(), info(), fine(), finer() and finest() methods |
|
| 47 |
* |
|
| 48 |
* set the log level with Log.setLevel() |
|
| 46 | 49 |
*/ |
| 47 | 50 |
public class Log {
|
| 48 | 51 |
/** The class id. */ |
| ... | ... | |
| 59 | 62 |
|
| 60 | 63 |
/** The flags. */ |
| 61 | 64 |
public static final int CONSOLE = 1; |
| 65 |
|
|
| 62 | 66 |
/** The caller information. */ |
| 63 | 67 |
protected static String sourceMethodName; |
| 64 | 68 |
protected static String sourceClassName; |
| ... | ... | |
| 241 | 245 |
public static void severe(String message) {
|
| 242 | 246 |
severe(message, STANDARD); |
| 243 | 247 |
} |
| 248 |
|
|
| 249 |
/** |
|
| 250 |
* Log a severe message using the default flag |
|
| 251 |
* |
|
| 252 |
* @param t the error to print |
|
| 253 |
*/ |
|
| 254 |
public static void severe(Throwable t) {
|
|
| 255 |
severe(t.getLocalizedMessage()); |
|
| 256 |
printStackTrace(t); |
|
| 257 |
} |
|
| 244 | 258 |
|
| 245 | 259 |
/** |
| 246 | 260 |
* Log a severe message |
| ... | ... | |
| 263 | 277 |
public static void warning(String message) {
|
| 264 | 278 |
warning(message, STANDARD); |
| 265 | 279 |
} |
| 280 |
|
|
| 281 |
/** |
|
| 282 |
* Log a warning message using the default flag |
|
| 283 |
* |
|
| 284 |
* @param t the error to print |
|
| 285 |
*/ |
|
| 286 |
public static void warning(Throwable e) {
|
|
| 287 |
warning(e.getLocalizedMessage()); |
|
| 288 |
printStackTrace(e); |
|
| 289 |
} |
|
| 266 | 290 |
|
| 267 | 291 |
/** |
| 268 | 292 |
* Log a warning message |
| ... | ... | |
| 288 | 312 |
/** |
| 289 | 313 |
* Log an info message using the default flag |
| 290 | 314 |
* |
| 291 |
* @param message
|
|
| 315 |
* @param t the error to print
|
|
| 292 | 316 |
*/ |
| 293 | 317 |
public static void info(Throwable t) {
|
| 294 |
info(t.getLocalizedMessage(), STANDARD);
|
|
| 318 |
info(t.getLocalizedMessage()); |
|
| 295 | 319 |
printStackTrace(t); |
| 296 | 320 |
} |
| 297 | 321 |
|
Formats disponibles : Unified diff