Skip to content

cLogger

Stephen P edited this page Aug 31, 2020 · 1 revision

Holds information about a logger instance, such as log filepath and date/time format.

Members

filepath

The filepath (local or absolute) to the logging file. Will create the file if it does not exist upon first logging call, but will not create any missing folders/directories.

dateTimeFormat

The date/time format used when displaying when a log entry happened, in a strftime() compatible time format. For more information see here.

Functions

initCLogger

void initCLogger(cLogger* logger, char* outFilepath, char* dateTimeFormat)
Initializes a cLogger with the specified log filepath and date/time format. Pass NULL into dateTimeFormat to receive a default format of mm dd yy HH:MM:SS TMZ. These initials are: mm = 2-digit month, dd = 2-digit day, yy = 2-digit year, HH = 24-hour hours, MM = minutes, SS = seconds, TMZ = timezone (abbreviation or full name).

cLogEvent

void cLogEvent(cLogger logger, char* entryType, char* brief, char* explanation)
Logs a specific event in the given format: dateTime - entryType: brief (explanation). dateTime is the date/time in the format described by the dateTimeFormat member.

destroyCLogger

void destroyCLogger(cLogger* logger) Destroys a given cLogger, freeing all associated memory.

Clone this wiki locally