Skip to content

cfnptr/logy

Repository files navigation

LOGY

A library providing generic API for messages logging across different platforms.

See the documentation

Features

  • Logging to file, stdout
  • Logging levels (fatal - trace)
  • Log file rotation
  • Multithreading safety
  • C and C++ implementations

Usage example

void loggerExampleCPP()
{
    logy::Logger logger("logs", INFO_LOG_LEVEL);

    int someValue = 123;
    logger.log(INFO_LOG_LEVEL, "Logged value: %d", someValue);
}
void loggerExampleC()
{
    Logger logger;
    LogyResult logyResult = createLogger("logs", INFO_LOG_LEVEL, true, 0.0, &logger);
    if (logyResult != SUCCESS_LOGY_RESULT) abort();

    int someValue = 123;
    logMessage(logger, INFO_LOG_LEVEL, "Logged value: %d", someValue);

    destroyLogger(logger);
}

Supported operating systems

  • Windows
  • macOS
  • Ubuntu (Linux)

Build requirements

Use building instructions to install all required tools and libraries.

CMake options

Name Description Default value
LOGY_BUILD_SHARED Build Logy shared library ON

CMake targets

Name Description Windows macOS Linux
logy-static Static Logy library .lib .a .a
logy-shared Dynamic Logy library .dll .dylib .so

Cloning

git clone --recursive https://github.com/cfnptr/logy

Building CI

  • Windows: ./scripts/build-release.bat
  • macOS / Ubuntu: ./scripts/build-release.sh

Third-party

  • mpio (Apache-2.0 License)
  • mpmt (Apache-2.0 License)