001: /**
002: * Objective Database Abstraction Layer (ODAL)
003: * Copyright (c) 2004, The ODAL Development Group
004: * All rights reserved.
005: * For definition of the ODAL Development Group please refer to LICENCE.txt file
006: *
007: * Distributable under LGPL license.
008: * See terms of license at gnu.org.
009: */package com.completex.objective.components.log;
010:
011: /**
012: * Log interface
013: *
014: * @author Gennady Krizhevsky
015: */
016: public interface Log {
017:
018: public static final NullLogger NULL_LOGGER = new NullLogger();
019:
020: boolean isDebugEnabled();
021:
022: boolean isErrorEnabled();
023:
024: boolean isFatalEnabled();
025:
026: boolean isInfoEnabled();
027:
028: boolean isTraceEnabled();
029:
030: boolean isWarnEnabled();
031:
032: void trace(Object o);
033:
034: void trace(Object o, Throwable throwable);
035:
036: void debug(Object o);
037:
038: void debug(Object o, Throwable throwable);
039:
040: void info(Object o);
041:
042: void info(Object o, Throwable throwable);
043:
044: void warn(Object o);
045:
046: void warn(Object o, Throwable throwable);
047:
048: void error(Object o);
049:
050: void error(Object o, Throwable throwable);
051:
052: void fatal(Object o);
053:
054: void fatal(Object o, Throwable throwable);
055:
056: /**
057: * Null log implementation
058: */
059: static class NullLogger implements Log {
060: public boolean isDebugEnabled() {
061: return false;
062: }
063:
064: public boolean isErrorEnabled() {
065: return false;
066: }
067:
068: public boolean isFatalEnabled() {
069: return false;
070: }
071:
072: public boolean isInfoEnabled() {
073: return false;
074: }
075:
076: public boolean isTraceEnabled() {
077: return false;
078: }
079:
080: public boolean isWarnEnabled() {
081: return false;
082: }
083:
084: public void trace(Object o) {
085: }
086:
087: public void trace(Object o, Throwable throwable) {
088: }
089:
090: public void debug(Object o) {
091: }
092:
093: public void debug(Object o, Throwable throwable) {
094: }
095:
096: public void info(Object o) {
097: }
098:
099: public void info(Object o, Throwable throwable) {
100: }
101:
102: public void warn(Object o) {
103: }
104:
105: public void warn(Object o, Throwable throwable) {
106: }
107:
108: public void error(Object o) {
109: }
110:
111: public void error(Object o, Throwable throwable) {
112: }
113:
114: public void fatal(Object o) {
115: }
116:
117: public void fatal(Object o, Throwable throwable) {
118: }
119: }
120: }
|