32 logger.
LogTrace(String.Format(
"Starting log to {0} example", loggerType));
33 logger.
LogInfo(
"An example of an informational line");
34 logger.
LogError(
"An example of an error log entry");
35 logger.
LogTrace(String.Format(
"Done with log to {0} example", loggerType));
45 Console.WriteLine(
"Bridge Exercise");
48 Console.WriteLine(
" Example of writing to a log file...");
54 Console.WriteLine(
" Example of writing to the console...");
60 Console.WriteLine(
" Example of writing to a Null object (no output)...");
64 Console.WriteLine(
" Done.");
Example of using the Bridge Pattern in C#.
void _Bridge_Exercise_Demonstrate_Logging(Logger logger, string loggerType)
Helper function to show an example of writing to a logger.
void Run()
Executes the example for the Bridge Pattern in C#.
Represents the logger object to be used in the program.
void LogInfo(string message)
Log informational messages to the configured output.
LoggerTypes
A value passed to Logger.Logger() constructor to specify the type of logger to create.
void LogTrace(string message)
Log trace messages to the configured output.
void LogError(string message)
Log error messages to the configured output.
The namespace containing all Design Pattern Examples implemented in C#.