Design Pattern Examples
Overview of object-oriented design patterns
Bridge_LogHelper.h File Reference

Declaration of the LogHelper_FormatLogLine() function, used in the Bridge Pattern. More...

#include <stdbool.h>
#include <stdlib.h>
Include dependency graph for Bridge_LogHelper.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define __BRIDGE_LOGHELPER_H__
 

Functions

bool LogHelper_FormatLogLine (const char *loglevel, const char *message, char *output, size_t maxOutputSize)
 Format a line for logging, including time stamp.
 

Detailed Description

Declaration of the LogHelper_FormatLogLine() function, used in the Bridge Pattern.

Definition in file Bridge_LogHelper.h.

Macro Definition Documentation

◆ __BRIDGE_LOGHELPER_H__

#define __BRIDGE_LOGHELPER_H__

Definition at line 8 of file Bridge_LogHelper.h.

Function Documentation

◆ LogHelper_FormatLogLine()

bool LogHelper_FormatLogLine ( const char *  loglevel,
const char *  message,
char *  output,
size_t  maxOutputSize 
)

Format a line for logging, including time stamp.

Parameters
loglevelLevel of logging (TRACE, INFO, ERROR)
messageMessage to log
outputBuffer to fill with the formatted log line.
maxOutputSizeMaximum size of output buffer in characters.
Returns
Returns true if the log was formatted into the buffer; otherwise, returns false.

Definition at line 29 of file Bridge_LogHelper.c.

References _GetTimeStamp().

Referenced by _WriteLine().