Skip to content

MatthewOwens/clogs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

clogs

thread-safe c logging, put your clogs on

usage

init clogs

clogs_init(NULL); // no log file

or

clogs_init("logfile.txt"); // all clog calls will be logged _and_ printed

add to clogs pool

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.

print from clogs pool

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)

free clogs

clogs_close()

clogs_close() will close the clogs log file and destroy the internal mutexes. Must be called to avoid memory leaks