https://github.com/silentvoid13/silent_log
dead simple single-header library to display some colored log messages
https://github.com/silentvoid13/silent_log
c logging-library
Last synced: 10 months ago
JSON representation
dead simple single-header library to display some colored log messages
- Host: GitHub
- URL: https://github.com/silentvoid13/silent_log
- Owner: SilentVoid13
- License: agpl-3.0
- Created: 2020-02-21T18:51:02.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-08-26T12:16:35.000Z (almost 2 years ago)
- Last Synced: 2025-03-26T06:11:25.146Z (over 1 year ago)
- Topics: c, logging-library
- Language: C
- Homepage:
- Size: 71.3 KB
- Stars: 6
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Silent_Log
This is a dead simple single-header library to display some colored log messages, based on ANSI colors.
It offers the following functions:
- `LOG_INFO`
- `LOG_ERROR`
- `LOG_WARN`
- `LOG_DEBUG`
## Usage
To use it in your code, just include the header file `log.h`.
```c
// if debug is not set, LOG_DEBUG is suppressed
#define DEBUG
#include "log.h"
int main() {
LOG_INFO("This is an info message\n");
LOG_ERROR("This is an error message\n");
LOG_WARN("This is a warning message\n");
int a = 1, b = 2, c = a + b;
LOG_INFO("%d + %d = %d !\n", a, b ,c);
LOG_DEBUG("This is a debugging message\n");
return 0;
}
```
## License
Silent_Log is licensed under the GNU AGPLv3 license. Refer to [LICENSE](https://github.com/SilentVoid13/Silent_Log/blob/master/LICENSE.txt) for more informations.