A simple header only library of logging methods to add to your project
wget https://raw.githubusercontent.com/KDesp73/logging.h/main/logging.h
INFO
WARN
ERRO
DEBU
(ifDEBUG
is defined)- Any other status using the
LOG
method
#include "logging.h"
int main(){
const char* ip = "127.0.0.1";
const char* username = "!user";
INFO("IP: %s\n", ip);
WARN("Address is local\n");
ERRO("Username \'%s\' contains special characters", username);
return 0;
}
Output:
[INFO] IP: 127.0.0.1
[WARN] Address is local
[ERRO] Username '!user' contains special characters