Implementation of the CreateLogger() and DestroyLogger() functions used in the Bridge Pattern. More...
#include <stdlib.h>
#include "Bridge_FileLogger.h"
#include "Bridge_ConsoleLogger.h"
#include "Bridge_NullLogger.h"
#include "Bridge_ILogger.h"
Go to the source code of this file.
Functions | |
ILogger * | CreateLogger (LoggerTypes loggerType, const char *filename) |
Return an interface for the specified logger. | |
void | DestroyLogger (ILogger *logger) |
Release any resources associated with the given logger. The given ILogger instance is no longer valid after this function returns. | |
Implementation of the CreateLogger() and DestroyLogger() functions used in the Bridge Pattern.
Definition in file Bridge_ILogger.c.
ILogger * CreateLogger | ( | LoggerTypes | loggerType, |
const char * | filename | ||
) |
Return an interface for the specified logger.
loggerType | A value from the LoggerTypes enumeration specifying the type of logger to create. |
filename | For LoggerType_ToFile, this is the path and name of the log file to write to. Ignored for other logger types. |
Definition at line 19 of file Bridge_ILogger.c.
References CreateConsoleLogger(), CreateFileLogger(), CreateNullLogger(), ILogger::loggerType, LoggerType_ToConsole, LoggerType_ToFile, and LoggerType_ToNull.
Referenced by Bridge_Exercise().
void DestroyLogger | ( | ILogger * | logger | ) |
Release any resources associated with the given logger. The given ILogger instance is no longer valid after this function returns.
logger | An ILogger object representing a logger to be destroyed. |
Definition at line 52 of file Bridge_ILogger.c.
References DestroyConsoleLogger(), DestroyFileLogger(), DestroyNullLogger(), ILogger::loggerType, LoggerType_ToConsole, LoggerType_ToFile, and LoggerType_ToNull.
Referenced by Bridge_Exercise().