https://github.com/jke94/scribe
C++ logger implementation based in a expansible concept: write your custom logger implementation.
https://github.com/jke94/scribe
cpp logger
Last synced: about 1 month ago
JSON representation
C++ logger implementation based in a expansible concept: write your custom logger implementation.
- Host: GitHub
- URL: https://github.com/jke94/scribe
- Owner: jke94
- Created: 2024-11-01T19:25:02.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-11-26T21:16:42.000Z (over 1 year ago)
- Last Synced: 2025-01-13T01:44:15.537Z (over 1 year ago)
- Topics: cpp, logger
- Language: C++
- Homepage:
- Size: 43 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
# scribe
1. C++ logger implementation based in a expansible concept: write your custom logger implementation.
2. C++ logger usefull logger based in provide a callback function to get traces with log level and message info to be recived from the client sides.
## Architecture (`logger/api` folder)
### Internal logger files.
- `LoggerApi.h`: File not exported to the client that wants to consume the library. Only to the one that wants to use the library. Define the basic functions to be called to log messages with different log levels.
- `Logger.h`: File not exported to the client that wants to consume the library. Only to the one that wants to use the library. It´s allow implement the functions. Define the functions consumed by the macros declared in `LoggerApi.h`. Abstracting to the library that uses `scribe` as logger system.
### External file consumed by the client.
- `ScribeApi.h`: The file that the clients can do `#include` to consume `scribe` logger.
## Usage example:
```
#include
#include "ScribeApi.h"
void logCallbackFunction(LOG_LEVEL loglevel, std::string logMessage)
{
// TODO: Implement the function reaction. Example, std::cout.
}
int main(int argc, char* argv[])
{
LOGGER_INFRASTRUCTURE_RESULT initializeLoggerResult = initializeLogger(logCallbackFunction);
LOGGER_INFRASTRUCTURE_RESULT configLogLevelResult = configMinimunLoggerLevel(LOG_LEVEL::VERBOSE);
return 0;
}
```
## Summary
`ScribeApi.h` is **the unique file** that must be visible to the client that want consume the callback. `LoggerApi.h` and `Logger.h`, also must be used to work with `scribe` as logger system.