Skip to content

codesmith-fi/debuglogger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A simple C++ console debug logger utility macro
 
This is a simple macro which implements a debug logger which can be used with stream output.
It supports a time stamp (default) but it can be omitted if so needed.

The logging can be used in streams with the stream '<<' operator
 
Usage with the time stamp:
    LOG_INFO() << "You failed " << 20 << "Times!"
    LOG_WARN() << "You failed " << 20 << "Times!"
    LOG_ERROR() << "You failed " << 20 << "Times!"

Usage without the time stamp:
    LOG_INFO_NT() << "You failed " << 20 << "Times!"
    LOG_WARN_NT() << "You failed " << 20 << "Times!"
    LOG_ERROR_NT() << "You failed " << 20 << "Times!"

Default macro with ERROR severity:
    LOG() << "You failed"
    LOG_NT() << "You failed"

Example output:

    INFO: No time here
    [2021-05-25 16:33:29] INFO: Starting
    [2021-05-25 16:33:29] INFO: Created Worker number: 0
    [2021-05-25 16:33:29] INFO: Created Worker number: 1
    [2021-05-25 16:33:29] INFO: Worker: 0 @0
    [2021-05-25 16:33:29] INFO: Worker: 1 @0

Modify the macro if you desire a different output format.

 Author: Erno Pakarinen
 Email: codesmith.fi@gmail.com
 Date: 25th of May 2021

 MIT License

About

Simple C++ macro for console debug logging

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages