C Logging library
Link the following example with -lclog
.
#include <clog.h>
void main() {
/* Set logging verbosidy */
// clog_verbosidy = CLOG_SILENT;
// clog_verbosidy = CLOG_FATAL;
// clog_verbosidy = CLOG_ERROR;
// clog_verbosidy = CLOG_WARNING;
// clog_verbosidy = CLOG_INFO;
clog_verbosity = CLOG_DEBUG;
/* These functions will append newline at the end of expression*/
DEBUG("Foo %s", "bar");
INFO("Foo %s", "bar");
WARN("Foo %s", "bar");
ERROR("Foo %s", "bar");
FATAL("Foo %s", "bar");
/* These functions will not append newline at the end of expression*/
DEBUGN("Foo %s\n", "bar");
INFON("Foo %s\n", "bar");
WARNN("Foo %s\n", "bar");
ERRORN("Foo %s\n", "bar");
FATALN("Foo %s", "bar");
}
mkdir build
cd build
cmake ..
make
cd build
make install
cd build
cpack
After that, libclog-*.deb
will be generated insode the build
directory.
cd build
sudo dpkg -i libclog-*.deb
sudo dpkg -P libclog
Or
sudo apt remove libclog