https://github.com/zarox28/logger-cpp
Simple logging library in C++
https://github.com/zarox28/logger-cpp
cpp logging
Last synced: about 1 year ago
JSON representation
Simple logging library in C++
- Host: GitHub
- URL: https://github.com/zarox28/logger-cpp
- Owner: Zarox28
- License: agpl-3.0
- Archived: true
- Created: 2024-02-03T13:07:21.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-02-05T23:46:35.000Z (over 2 years ago)
- Last Synced: 2025-03-14T00:15:34.632Z (over 1 year ago)
- Topics: cpp, logging
- Language: C++
- Homepage:
- Size: 96.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Logger


> Version: **1.2.0**
---
## Table of Contents
- [About](#about)
- [Features](#features)
- [Installation](#installation)
- [Usage](#usage)
- [Init](#init)
- [Reset](#reset)
- [Debug](#debug)
- [Info](#info)
- [Success](#success)
- [Warning](#warning)
- [Error](#error)
- [Fatal](#fatal)
- [Changelog](#changelog)
- [Contributing](#contributing)
- [License](#license)
- [Authors](#authors)
## About
This is a simple `C++` logger that can be used to log messages to the console or to a file.
## Features
- Debug, Info, Warning, Error and Fatal log levels
## Installation
1. Add the `Logger` submodule to your project
```bash
git submodule add https://github.com/Zarox28/Logger.git libs/Logger
```
2. Initialize the submodule & update it
```bash
git submodule update --init --recursive
```
3. Include the `Logger` header file in your project
```cpp
#include "libs/Logger/Logger.h"
```
> **Note:** The `Logger` submodule is located in the `libs` directory of your project.
> **Tip:** You can also add `using namespace Logger;` to your project to avoid having to type `Logger::` before every log level.
## Usage
### Init
```cpp
Logger::init();
```
### Reset
```cpp
Logger::reset();
```
### Debug
```cpp
Logger::debug("This is a debug message");
```
Preview

### Info
```cpp
Logger::info("This is an info message");
```
Preview

### Success
```cpp
Logger::success("This is a success message");
```
Preview

### Warn
```cpp
Logger::warn("This is a warning message");
```
Preview

### Error
```cpp
Logger::error("This is an error message");
```
Preview

### Fatal
```cpp
Logger::fatal("This is a fatal message");
```
Preview

> **Note:** Fatal log message blink in red to catch the user's attention.
## Changelog
see [CHANGELOG.md](CHANGELOG.md) for latest changes.
## Contributing
Contributing is disabled for this repository.
## License
This project is licensed under the AGPL v3 License - see the [LICENSE](LICENSE.md) file for details.
## Authors
- **[@Zarox28](https://github.com/Zarox28)**