Skip to content

CMDR-JohnAlex/SimpleLogger

Repository files navigation

simpleLogger

GitHub Repo stars GitHub watchers

GitHub top language Lines of code GitHub repo size

GitHub issues GitHub pull requests GitHub

GitHub release (latest by date) GitHub all releases

About simpleLogger

simpleLogger is a small header and source file logging library made in C++.

Platforms

simpleLogger should work on all operating systems such as Windows, Linux and Mac OS but is currently tested on the following:

  • Windows 10
  • Windows 11

Features

  • Simple integration
    • Just two files, logger.hpp and logger.cpp
    • Only include logger.hpp
  • Small and simple library
    • Cross-platform
    • Small header with minimal includes for speed
    • No external dependencies
  • Multiple log targets
    • Console logging (Console colors supported!)
    • File logging
    • And the best part, the code is extendable so you can add different log targets

Usage example

You can use src/main.cpp as an example on how to use everything in this library.

Here is a quick example:

#include "logger.hpp"

int main()
{
	// Log examples
	logger.log("Example of an unknown log severity");
	logger.log(FAILURE, "Imminent program failure");
	logger.log(ERROR, "Error, but program can continue");
	logger.log(WARNING, "Warning");
	logger.log(IMPORTANT, "Important messages, more relevant than regular info messages");
	logger.log(INFO, "Default level on release builds. Used for general messages");
	logger.log(DEBUG, "Default level on debug builds. Used for messages that are only relevant to the developer");
	logger.log(VERBOSE, "Verbose level on debug builds. Useful when developers need more information");
	
	return 0;
}

Documentation

Our Documentation can be found in the code's //comments and an example to use this library is in src/main.cpp

Bug Reporting

You can report bugs in the issues tab in the github repository.

Contributing

If you want to contribute, you can create a pull request so we can consider your contribution.

Please add your name and/or Github username to AUTHORS.md in your pull request.

Changelog

Please see CHANGELOG.md.

About

A simple and super small logger made in C++

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages