Design Pattern Examples
Overview of object-oriented design patterns
Bridge_NullLogger.cs
Go to the documentation of this file.
1
5
6using System;
7
9{
13 internal class NullLogger : ILogger, IDisposable
14 {
18 private NullLogger()
19 {
20 }
21
22
23 #region ILogger Members
24
25 void ILogger.LogTrace(string msg)
26 {
27 }
28
29 void ILogger.LogInfo(string msg)
30 {
31 }
32
33 void ILogger.LogError(string msg)
34 {
35 }
36
37 #endregion
38
39 #region IDisposable Members
40
44 void IDisposable.Dispose()
45 {
46 }
47
48 #endregion
49
50
55 public static ILogger CreateNullLogger()
56 {
57 return new NullLogger();
58 }
59 }
60}
Represents a logger that throws away anything sent its way.
static ILogger CreateNullLogger()
Create an instance of a null logger, a logger that doesn't do anything.
Represents an implementation of a logger object as call from the Logger class.
void LogError(string msg)
Log error messages to the configured output.
void LogTrace(string msg)
Log trace messages to the configured output.
void LogInfo(string msg)
Log informational messages to the configured output.
The namespace containing all Design Pattern Examples implemented in C#.