clogs_init(NULL); // no log file
or
clogs_init("logfile.txt"); // all clog calls will be logged _and_ printed
CLOG("info message");
CLOG_WARN("warn message");
CLOG_ERR("error message");
formatted mesasges are also supported, for example:
CLOG("%d pairs of clogs", 2);
newlines are appended by clog and don't need to be passed.
clogs_update()
clogs_update()
should be called periodically to flush the clogs queue,
printing any messages. This should also handle OS signals, however this is
still in development (see issue #2)
clogs_close()
clogs_close()
will close the clogs log file and destroy the internal mutexes.
Must be called to avoid memory leaks