MEONMedical / Log4Qt

Log4Qt - Logging for the Qt cross-platform application framework
Apache License 2.0
580 stars 234 forks source link
cmake cpp cpp11 log4qt logging logging-library qbs qmake qt-framework qt5 qt6

Log4Qt - Logging for the Qt cross-platform application framework

Continuous Integration

Github actions CMake Ubuntu CMake Ubuntu build and test

Appveyor CI (Windows) Build status

Description

Log4Qt is a C++ port of the Apache Software Foundation Log4j package using the Qt Framework. It is intended to be used by open source and commercial Qt projects.

Original project

http://log4qt.sourceforge.net/

This Log4Qt repository is a clone of the Log4Qt repository from https://gitorious.org/log4qt which was itself a clone of the original Log4Qt project on SourceForge http://sourceforge.net/projects/log4qt/ (http://log4qt.sourceforge.net/).

Additional features

Requirements

License

Apache License 2, Version 2.0

Clone

git clone https://github.com/MEONMedical/Log4Qt.git

Build and install

qmake

use qmake to build the project

*NIX
    qmake
    make
    make install

WIN* (mingw)
    qmake
    mingw32-make
    mingw32-make install

WIN* (msvc)
    qmake
    msbuild Log4Qt.sln
    msbuild /t:INSTALL Log4Qt.sln

For static build call qmake with
qmake "DEFINES+=LOG4QT_STATIC" or uncommend LOG4QT_STATIC in the build.pri file
Don't forget to define LOG4QT_STATIC also in your project.

Logging to a database via databaseappender can be enabled with qmake "QT += sql"

include in your project

Can also be used by adding the log4qt source directly to your Qt project file by adding the following line: include(/src/log4qt/log4qt.pri)

cmake

cmake is the second option to build Log4Qt. An out-of-source build is required: <unpack/fetch to Log4Qt directory> mkdir Log4Qt-build cd Log4Qt-build cmake ../Log4Qt make/mingw32-make/msbuild Log4Qt.sln (same as with qmake) make/mingw32-make install or: msbuild /t:INSTALL Log4Qt.sln

Addition cmake options are
    * '-DBUILD_STATIC_LOG4CXX_LIB=ON|OFF' to build static log4qt lib (default: OFF)
    * '-DBUILD_WITH_DB_LOGGING=ON|OFF' to build with database logging support