-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME
More file actions
38 lines (27 loc) · 1.15 KB
/
Copy pathREADME
File metadata and controls
38 lines (27 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
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