CLog Documentation

using namespace CLog;

Public Methods

CLog(const char *path, bool append_mode = false);

This is the only available constructor. The first argument is the absolute or relative path to the file that will act as our log file. The second argument decides whether or not to append to an existing file (if it's true), or replace the existing log file (if any).

~Clog();

Basic public deconstructor. Frees memory used by the object.

void write(char *text,...);

This is the one and only function that is used with this object outside of the construction and deconstruction. Its arguments behave exactly like the ones of the fprintf(...) function so refer to man fprintf for more details. The function makes sure that the log file is opened for writing. It prepends the current time and date in front of the log file entry. After writing it will close the file. This makes sure that the log entries will not be lost in the event of a runtime error. See the tutorial for more details.


"Anyone considered to be "slacking," including superiors, will lose their respect - and will generally be made aware of this."

Last update: Wednesday, 11th October, 2023
Copyright © 2001-2024 by Lukasz Tomicki