01: /*
02: * Copyright 2007 Hippo.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16: package nl.hippo.cms.brokenlinkchecker.log;
17:
18: /**
19: * <p>
20: * This logger discards any log messages.
21: * </p>
22: *
23: * <p>
24: * All instances of this class behave the same, so a single instance can be used
25: * by all clients. For convenience this class alread created an instance. Use
26: * {@link #getInstance()} to obtain it.
27: * </p>
28: */
29: public class NoOperationLog implements BrokenLinkCheckerLog {
30: /**
31: * <p>
32: * An instance of this class that can be shared by all clients.
33: * </p>
34: */
35: private static final NoOperationLog INSTANCE = new NoOperationLog();
36:
37: /**
38: * <p>
39: * Get an instance that can be used by all clients.
40: * </p>
41: *
42: * @return an instance that can be shared by all clients.
43: */
44: public static final NoOperationLog getInstance() {
45: return INSTANCE;
46: }
47:
48: /**
49: * <p>
50: * Create an instance of a log that discards all messages.
51: * </p>
52: */
53: public NoOperationLog() {
54: super ();
55:
56: // No action needed. There is nothing to initialize.
57: }
58:
59: public void warning(String message, Exception cause) {
60: // No action needed. This logger discards all messages.
61: }
62:
63: public void error(String message) {
64: // No action needed. This logger discards all messages.
65: }
66:
67: public void error(String message, Exception cause) {
68: // No action needed. This logger discards all messages.
69: }
70: }
|