Skip to content

kosenkov/cpp-logging

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Logging

Typing SVG

⚠️ The library is currently under development!

‼️ The library is temporarily not thread-safe!

Now you can already:

✔️ Create your own class "writer" for writing according to your preferences (see example);

✔️ Create your own "formatter" for data output;

✔️ Carticipate in the development of the library;

✔️ Contact me for constructive criticism and suggestions for improvement;

How to use (see example):

#include "../include/Logging.h"
#include "TxtWriter.h"
#include "TxtFormatter.h"

int main()
{
    TxtWriter<TxtFormatter> writer("LoggerTest.txt");
    Logging::Logger::init(&writer);

    logf_e("Error message with arg: Num=%d, Str=%s",     1, "Error message");
    logf_w("Warning message with arg : Num=%d, Str=%s",  2, "Warning message");
    logf_i("Info message with arg : Num=%d, Str=%s",     3, "Info message");
    logf_d("Debug message with arg : Num=%d, Str=%s",    4, "Debug message");

    log_e("Error message without args.");
    log_w("Warning message without args.");
    log_i("Info message without args.");
    log_d("Debug message without args.");

    return 0;
}

📫 How to reach me:

Linkedin Badge Gmail Badge

About

Very simple implementation for logging

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published