Skip to content

glpetrikov/FrameLog

Repository files navigation

FrameLog

FrameLog is a lightweight library for outputting logs to the console and file in C++.

Version 1.9.0-release

Language License

Status Size C++


GitHub Repo stars GitHub forks GitHub issues

Warning

Lua in GitHub statistics is just a build system. Don't pay attention and don't think there's anything wrong with Lua.

Features

  • Lightweight - Only 79.1 KiB when compiled in Release mode
  • Buffered console output - Efficient string accumulation before flush
  • File logging - Simple file writer with append/overwrite modes
  • Stream API - logger.custom << "Message " << value << "\n";
  • Color support - ANSI colors + RGB (24-bit true color)
  • Simple API - Trace, Print, Info, Warn, Error, Fatal levels
  • Cross-platform - Linux, Windows, macOS
  • Minimal dependencies - Only standard C++ library
  • Patterns - output with the required data (for example, time, date, LogLevel)

Dependencies

  • Standard C++ library (std)
  • Compatible with C++17 and later

Output Example:

Color-Example

License

FrameLog is distributed under the MIT License.
See LICENSE for details.

Supported Platforms

Any platform with the standard C++ library

Connect to your premake-file

add line: include "FrameLog/include/FrameLog/premake5.lua"

Performance & Size

FrameLog size is 79.1 KIB Measured FrameLog: Release builds, x64, premake5, gcc15, make

Why so small?

  • Minimal dependencies (only std)

Perfect for:

  • Docker containers (minimal images)
  • Fast compilation times
  • Quick program startup
  • for projects where you just need a logger

Status

FrameLog is currently in Release stage

Quick Start

git clone https://github.com/glpetrikov/FrameLog
cd FrameLog && premake5 gmake2 && cd build && make config=release
cd Release && ./sandbox

Building

Warning

If there are bugs in FrameLog API calls, they will be displayed in ANY configuration

Windows

premake

premake5 vs2022

open visual studio(2022) press f5

or

./run.sh

Linux

premake

./run.sh

Example

Source files:

Colors
Logger.cpp
Logger.hpp

example code:

  1. Include FrameLog in your code and use it:
#include <FrameLog/FrameLog.h>

using namespace FrameLog;

int main() {
    Logger logger("Main");

    logger.custom << "Hello, FrameLog" << FL_VERSION << "-" << FL_STATUS << logger.EndL();
}

More examples can be found in the examples folder.

  1. build See the "Building" section above.

Authors

Gleb Petrikov

Roadmap

Alpha (Completed)

  • Buffered output
  • Basic output functions
  • Color support
  • Basic log levels

Beta (Completed)

  • Additional log levels
  • Base Custom format patterns
  • Base Output pattern scanner
  • File Log
  • Minimal Log Level

Release (Current)(Completed)

  • full-fledged Custom format patterns
  • full-fledged Output pattern scanner
  • Additional buffer capabilities