8#include "helpers/formatstring.h"
27 Logger& logger, std::string loggerType)
33 logger.
LogInfo(
"An example of an informational line");
34 logger.
LogError(
"An example of an error log entry");
59 std::cout << std::endl;
60 std::cout <<
"Bridge Exercise" << std::endl;
65 Logger logger(
"Bridge.log");
66 std::cout <<
" Example of writing to a log file..." << std::endl;
72 std::cout <<
" Example of writing to the console..." << std::endl;
78 std::cout <<
" Example of writing to a Null object (no output)..."
84 std::cout <<
" Done." << std::endl;
static void _Bridge_Exercise_Demonstrate_Logging(ILogger *logger, const char *loggerType)
Helper function to show an example of writing to a logger.
Declaration of the Logger class used in the Bridge Pattern.
Represents the logger object to be used in the program.
void LogInfo(std::string message)
Log informational messages to the configured output.
void LogTrace(std::string message)
@ ToNull
Log to nowhere, that is, throw out all logging. No additional parameters.
@ ToConsole
Log to the console. No additional parameters.
void LogError(std::string message)
Log error messages to the configured output.
Declaration of the Bridge_Exercise() function as used in the Bridge Pattern.
The namespace containing all Design Pattern Examples implemented in C++.
void Bridge_Exercise()
Example of using the Bridge design pattern.
std::string formatstring(const char *fmt,...)
Use the given string and arguments to return a buffer containing the formatted string....