Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hulkiedo17/logc
logc - small and simple C/C++ logger library
https://github.com/hulkiedo17/logc
c c-plus-plus library linux log logger unix
Last synced: 17 days ago
JSON representation
logc - small and simple C/C++ logger library
- Host: GitHub
- URL: https://github.com/hulkiedo17/logc
- Owner: hulkiedo17
- License: apache-2.0
- Created: 2022-07-06T15:46:28.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2022-08-07T14:35:20.000Z (over 2 years ago)
- Last Synced: 2024-07-30T20:58:26.122Z (3 months ago)
- Topics: c, c-plus-plus, library, linux, log, logger, unix
- Language: C
- Homepage:
- Size: 15.6 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# What is this?
This is a small and simple c logger library for C/C++.
You can see comments that describes the functions in library in logc.h file. Also you can see the options for build.sh script, just pass them -h option.
# How to compile
To compile library, you need to run build.sh, like this:
```sh
$ ./build.sh
```# Usage
To using library in your projects, you need to include logc.h header file, and link your code like this:
```sh
$ gcc [files...] -llogc [options...]
```Also, before starting usage macros, initialize the logger, by calling init_logger(). Then you can use macros. Below you can see small example:
```c
#include
#include "logc.h"int main(void)
{
// NULL and true means that logger will be used default path to log file
init_logger(NULL, true);log_debug("test log #1");
log_warning("test log #2");
}
```