https://github.com/kdesp73/logging.h
A simple header only library of logging methods to add to your project
https://github.com/kdesp73/logging.h
c header-only logging
Last synced: over 1 year ago
JSON representation
A simple header only library of logging methods to add to your project
- Host: GitHub
- URL: https://github.com/kdesp73/logging.h
- Owner: KDesp73
- License: mit
- Created: 2024-03-13T18:50:07.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-03-13T19:06:39.000Z (over 2 years ago)
- Last Synced: 2025-01-23T06:09:16.386Z (over 1 year ago)
- Topics: c, header-only, logging
- Language: C
- Homepage:
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# logging.h
A simple header only library of logging methods to add to your project
## Get the file
```console
wget https://raw.githubusercontent.com/KDesp73/logging.h/main/logging.h
```
## Log Status
- `INFO`
- `WARN`
- `ERRO`
- `DEBU` (if `DEBUG` is defined)
- Any other status using the `LOG` method
## Example
```c
#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
```
## LICENSE
[MIT](./LICENSE)
## Author
[KDesp73](https://github.com/KDesp73)