01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one
03: * or more contributor license agreements. See the NOTICE file
04: * distributed with this work for additional information
05: * regarding copyright ownership. The ASF licenses this file
06: * to you under the Apache License, Version 2.0 (the
07: * "License"); you may not use this file except in compliance
08: * with the License. You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing,
13: * software distributed under the License is distributed on an
14: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15: * KIND, either express or implied. See the License for the
16: * specific language governing permissions and limitations
17: * under the License.
18: */
19: package org.apache.openjpa.lib.log;
20:
21: /**
22: * A log factory implementation that does not do any logging, as
23: * quickly as possible.
24: *
25: * @author Patrick Linskey
26: */
27: public class NoneLogFactory implements LogFactory {
28:
29: public final Log getLog(String channel) {
30: return NoneLog.getInstance();
31: }
32:
33: /**
34: * No-op log.
35: */
36: public static class NoneLog implements Log {
37:
38: private static final NoneLog s_log = new NoneLog();
39:
40: public static NoneLog getInstance() {
41: return s_log;
42: }
43:
44: public final boolean isErrorEnabled() {
45: return false;
46: }
47:
48: public final boolean isFatalEnabled() {
49: return false;
50: }
51:
52: public final boolean isInfoEnabled() {
53: return false;
54: }
55:
56: public final boolean isTraceEnabled() {
57: return false;
58: }
59:
60: public final boolean isWarnEnabled() {
61: return false;
62: }
63:
64: public final void trace(Object o) {
65: }
66:
67: public final void trace(Object o, Throwable t) {
68: }
69:
70: public final void info(Object o) {
71: }
72:
73: public final void info(Object o, Throwable t) {
74: }
75:
76: public final void warn(Object o) {
77: }
78:
79: public final void warn(Object o, Throwable t) {
80: }
81:
82: public final void error(Object o) {
83: }
84:
85: public final void error(Object o, Throwable t) {
86: }
87:
88: public final void fatal(Object o) {
89: }
90:
91: public final void fatal(Object o, Throwable t) {
92: }
93: }
94: }
|