easyloggingpp-9.96.7/000077500000000000000000000000001337606222400145035ustar00rootroot00000000000000easyloggingpp-9.96.7/.github/000077500000000000000000000000001337606222400160435ustar00rootroot00000000000000easyloggingpp-9.96.7/.github/PULL_REQUEST_TEMPLATE.md000066400000000000000000000004031337606222400216410ustar00rootroot00000000000000### This is a - [ ] Breaking change - [ ] New feature - [ ] Bugfix ### I have - [ ] Merged in the latest upstream changes - [ ] Updated [`CHANGELOG.md`](CHANGELOG.md) - [ ] Updated [`README.md`](README.md) - [ ] [Run the tests](README.md#install-optional) easyloggingpp-9.96.7/.gitignore000066400000000000000000000001421337606222400164700ustar00rootroot00000000000000build/* build-* *.pro.user .DS_Store release.info bin/* logs/* experiments/* CMakeLists.txt.user* easyloggingpp-9.96.7/.travis.yml000066400000000000000000000045111337606222400166150ustar00rootroot00000000000000language: cpp matrix: include: # - os: linux # dist: trusty # compiler: clang # before_install: # - sudo add-apt-repository ppa:kubuntu-ppa/backports -y # - sudo apt-get -qq update # - sudo apt-get install -y libgtest-dev valgrind cmake # - sudo apt-get install --only-upgrade cmake # - sudo wget https://github.com/google/googletest/archive/release-1.7.0.tar.gz # - sudo tar xf release-1.7.0.tar.gz # - cd googletest-release-1.7.0 # - sudo cmake -DBUILD_SHARED_LIBS=ON . # - sudo make # - sudo cp -a include/gtest /usr/include # - sudo cp -a libgtest_main.so libgtest.so /usr/lib/ # - g++ -v - os: linux dist: trusty compiler: gcc env: - COMPILER=g++-4.8 addons: apt: sources: ['ubuntu-toolchain-r-test'] packages: [g++-4.8, valgrind] - os: linux dist: trusty compiler: gcc env: - COMPILER=g++-4.9 addons: apt: sources: ['ubuntu-toolchain-r-test'] packages: [g++-4.9, valgrind] - os: linux dist: trusty compiler: gcc env: - COMPILER=g++-5 addons: apt: sources: ['ubuntu-toolchain-r-test'] packages: [g++-5, valgrind] - os: linux dist: trusty compiler: gcc env: - COMPILER=g++-6 addons: apt: sources: ['ubuntu-toolchain-r-test'] packages: [g++-6, valgrind] - os: linux dist: trusty compiler: gcc env: - COMPILER=g++-7 addons: apt: sources: ['ubuntu-toolchain-r-test'] packages: [g++-7, valgrind] before_install: - sudo apt-get -qq update - sudo apt-get install -y libgtest-dev valgrind cmake - sudo wget https://github.com/google/googletest/archive/release-1.7.0.tar.gz - sudo tar xf release-1.7.0.tar.gz - cd googletest-release-1.7.0 - sudo cmake -DBUILD_SHARED_LIBS=ON . - sudo make - sudo cp -a include/gtest /usr/include - sudo cp -a libgtest_main.so libgtest.so /usr/lib/ - which valgrind - cd "${TRAVIS_BUILD_DIR}" before_script: - cd test/ - cmake -Dtest=ON ../ - make - ls -l script: "./easyloggingpp-unit-tests -v && cd ../samples/STL && pwd && sh ./.travis_build.sh && valgrind ./bin/very-basic.cpp.bin" branches: only: - master - develop notifications: recipients: - mkhan3189@gmail.com email: on_success: never on_failure: change rvm: - 9.00 easyloggingpp-9.96.7/ACKNOWLEDGEMENTS.md000066400000000000000000000031651337606222400173640ustar00rootroot00000000000000# Acknowledgements This file contains list of contributors and acknowledgement of their efforts in making this library better especially by making acceptable code changes. If we have missed your name please feel free to add it with contribution link. | **Github User** | **Contribution** | |--------------------------------------|----------------------------------| | [@aparajita](https://github.com/aparajita) | [Separated out .h and .cc file](https://github.com/muflihun/easyloggingpp/pulls?q=is%3Apr+author%3Aaparajita) | | [@adah1972](https://github.com/adah1972) | [A lot of contributions](https://github.com/muflihun/easyloggingpp/pulls?q=is%3Apr+author%3Aadah1972) | | [@miguelmartin75](https://github.com/miguelmartin75) | [Issue #11](https://github.com/muflihun/easyloggingpp/issues/11), [PR #16](https://github.com/muflihun/easyloggingpp/pull/16) | | [@moneromooo-monero](https://github.com/moneromooo-monero) | [A lot of contributions](https://github.com/muflihun/easyloggingpp/pulls?q=is%3Apr+author%3Amoneromooo-monero)| | [@MonsieurNicolas](https://github.com/MonsieurNicolas) | [PR #593](https://github.com/muflihun/easyloggingpp/pull/593) | | [@acowley](https://github.com/acowley) | [PR #593](https://github.com/muflihun/easyloggingpp/pull/577) | | [@rggjan](https://github.com/rggjan) | [PR 561](https://github.com/muflihun/easyloggingpp/pull/561) | | [@sgtcodfish](https://github.com/sgtcodfish) | Support for emscripten | easyloggingpp-9.96.7/CHANGELOG.md000066400000000000000000000104341337606222400163160ustar00rootroot00000000000000# Change Log ## [9.96.7] - 24-11-2018 - Adds support for compiling easyloggingpp using Emscripten. This allows the library to be compiled into Javascript or WebAssembly and run in the browser while logging to the browser's Javascript console. ## [9.96.6] - 24-11-2018 - Storage constructor (indirectly) attempts to access elStorage before it's initialized (issue #660) (@Barteks2x) - Fixed unused variable warning while build without performance logging feature (@wrgcpp) - Updated license ## [9.96.5] - 07-09-2018 ### Fixes - Check for level enabled when using custom log message (Advanced) (issue #666) - Ignore interruption signal crash log ## [9.96.4] - 03-04-2018 ### Fixes - Fixes seg fault with global lock (issue #580) ## [9.96.3] - 01-04-2018 ### Fixes - Demangling in GCC fixed - `ELPP_NO_DEFAULT_LOG_FILE` now logs to null device on major platforms (windows and unix) - Fixes unused warnings for constants ## [9.96.2] - 27-02-2018 ### Updates - Dispatcher now passes in pointer to log message instead of creating on the fly - Introduced new constructor for `Writer` for advanced usage (see muflihun/residue) - Use `std::unordered_map` for memory management instead of `std::map` issue #611 ## [9.96.1] - 23-02-2018 ### Fixes - Two loggers writing to same file is undefined behaviour #613 ## [9.96.0] - 14-02-2018 ### Fixes - Potential deadlocks in extreme edge case #609 - Respect `MaxLogFileSize` setting even when `ELPP_NO_DEFAULT_LOG_FILE` is set (@MonsieurNicolas) - Disable log file **initially** when using `ELPP_NO_LOG_TO_FILE`, to be consistent with documentation (@rggjan) ### Updates - `el::Storage` no longer contains locks as it should be - Reformatted both files with `astyle` - License text updated ### Added - Install a pkg-config `.pc` file (@acowley) ## [9.95.4] - 10-02-2018 ### Fixes - Fix documentation (see PR#597) - Fix buffer underflow in getBashOutput (see PR#596) ### Updates - Added new function `Helpers::reserveCustomFormatSpecifier` (see #606) - Made `DateTime::buildTimeInfo` public for use ## [9.95.3] - 13-10-2017 ### Fixes - Multithreading issue fixed raised from last release at log builder ## [9.95.2] - 12-06-2017 ### Fixes - Build fix for kFreeBSD as suggested in issue #563 - Fixed issue with deadlock on dispatch (see #571) - Fixed printf like logging with thread safety (see #572) ### Updates - Added support for AIX (thanks to @apollo13) ## [9.95.0] - 02-08-2017 ### Added - Added NetBSD as unix [coypoop](https://github.com/muflihun/easyloggingpp/pull/548/commits) - Ignore `NDEBUG` or `_DEBUG` to determine whether debug logs should be enabled or not. Use `ELPP_DISABLE_DEBUG_LOGS` ### Fixes - Fix compile when `_USE_32_BIT_TIME_T` defined [gggin](https://github.com/muflihun/easyloggingpp/pull/542/files) - Fix invalid usage of safeDelete which can cause an error with valgrind [Touyote](https://github.com/muflihun/easyloggingpp/pull/544/files) - Add code to ensure no nullptr references [tepperly](https://github.com/muflihun/easyloggingpp/pull/512/files) ## [9.94.2] - 12-04-2017 ### Added - CMake option to create static lib (thanks to @romariorios) - Ability to use UTC time using `ELPP_UTC_DATETIME` (thanks to @romariorios) - CMake module updated to support static lib ### Changes - Renamed long format specifiers to full names with padding for readbility ### Fixes - Fixed Android NDK build (thanks to @MoroccanMalinois) - Fix `ELPP_DISABLE_LOGS` not working in VS (thanks to @goloap) #365 ## [9.94.1] - 25-02-2017 ### Fixed - Fixes for `/W4` level warnings generated in MSVC compile (Thanks to [Falconne](https://github.com/Falconne)) - Fixed links - Fixes removing default logger if other than `default` ### Changes - Changed documentation to mention `easylogging++.cc` in introduction and added links to features ## [9.94.0] - 14-02-2017 ### Fixed - Fixed performance tracking time unit and calculations ### Added - Restored `ELPP_DEFAULT_LOGGER` and `ELPP_DEFAULT_PERFORMANCE_LOGGER` - `Helpers::getThreadName` for reading current thread name - Custom format specifier now has to return `std::string` instead - Merged `thread_name` with `thread` if thread name is available it's used otherwise ID is displayed For older versions please refer to [https://github.com/muflihun/easyloggingpp/tree/master/doc](https://github.com/muflihun/easyloggingpp/tree/master/doc) easyloggingpp-9.96.7/CMakeLists.txt000066400000000000000000000063541337606222400172530ustar00rootroot00000000000000cmake_minimum_required(VERSION 2.8.7) project(Easyloggingpp CXX) macro(require_cpp11) if (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 3.0) # CMake 3.1 has built-in CXX standard checks. message("-- Setting C++11") set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED on) else() if (CMAKE_CXX_COMPILER_ID MATCHES "GCC") message ("-- GNU CXX (-std=c++11)") list(APPEND CMAKE_CXX_FLAGS "-std=c++11") elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") message ("-- CLang CXX (-std=c++11)") list(APPEND CMAKE_CXX_FLAGS "-std=c++11") else() message ("-- Easylogging++ requires C++11. Your compiler does not support it.") endif() endif() endmacro() option(test "Build all tests" OFF) option(build_static_lib "Build easyloggingpp as a static library" OFF) option(lib_utc_datetime "Build library with UTC date/time logging" OFF) set(ELPP_MAJOR_VERSION "9") set(ELPP_MINOR_VERSION "96") set(ELPP_PATCH_VERSION "7") set(ELPP_VERSION_STRING "${ELPP_MAJOR_VERSION}.${ELPP_MINOR_VERSION}.${ELPP_PATCH_VERSION}") set(ELPP_INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include" CACHE PATH "The directory the headers are installed in") set(ELPP_PKGCONFIG_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/share/pkgconfig" CACHE PATH "Installation directory for pkgconfig (.pc) files") include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include) install(FILES src/easylogging++.h src/easylogging++.cc DESTINATION "${ELPP_INCLUDE_INSTALL_DIR}" COMPONENT dev) configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/cmake/easyloggingpp.pc.cmakein ${CMAKE_CURRENT_BINARY_DIR}/easyloggingpp.pc @ONLY) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/easyloggingpp.pc DESTINATION "${ELPP_PKGCONFIG_INSTALL_DIR}") if (build_static_lib) if (lib_utc_datetime) add_definitions(-DELPP_UTC_DATETIME) endif() require_cpp11() add_library(easyloggingpp STATIC src/easylogging++.cc) set_property(TARGET easyloggingpp PROPERTY POSITION_INDEPENDENT_CODE ON) install(TARGETS easyloggingpp ARCHIVE DESTINATION lib) endif() export(PACKAGE ${PROJECT_NAME}) ########################################## Unit Testing ################################### if (test) # We need C++11 require_cpp11() set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake") find_package (gtest REQUIRED) include_directories(${gtest_SOURCE_DIR}/include ${gtest_SOURCE_DIR}) enable_testing() if (EMSCRIPTEN) set(CMAKE_EXE_LINKER_FLAGS "-O2 -s TOTAL_MEMORY=134217728") endif() add_executable(easyloggingpp-unit-tests src/easylogging++.cc test/main.cc ) target_compile_definitions(easyloggingpp-unit-tests PUBLIC ELPP_FEATURE_ALL ELPP_LOGGING_FLAGS_FROM_ARG ELPP_NO_DEFAULT_LOG_FILE ELPP_FRESH_LOG_FILE ) # Standard linking to gtest stuff. target_link_libraries(easyloggingpp-unit-tests gtest gtest_main) add_test(NAME easyloggingppUnitTests COMMAND easyloggingpp-unit-tests -v) endif() easyloggingpp-9.96.7/LICENSE000066400000000000000000000022501337606222400155070ustar00rootroot00000000000000The MIT License (MIT) Copyright (c) 2012-2018 Zuhd Web Services Copyright (c) 2012-2018 @abumusamq https://github.com/zuhd-org/ https://zuhd.org https://muflihun.com Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. easyloggingpp-9.96.7/README.md000066400000000000000000003010321337606222400157610ustar00rootroot00000000000000

![banner] > **Manual For v9.96.7** [![Build Status (Master)](https://img.shields.io/travis/muflihun/easyloggingpp/master.svg)](#build-matrix) [![Build Status (Develop)](https://img.shields.io/travis/muflihun/easyloggingpp/develop.svg)](#build-matrix) [![Build status](https://ci.appveyor.com/api/projects/status/sfcgrehu8ypkrun3?svg=true)](https://ci.appveyor.com/project/abumusamq/easyloggingpp-node) [![Node Binding Version](https://img.shields.io/github/release/muflihun/easyloggingpp.svg)](https://github.com/muflihun/easyloggingpp/releases/latest) [![Version](https://img.shields.io/npm/v/easyloggingpp.svg)](https://www.npmjs.com/package/easyloggingpp) [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/muflihun/easyloggingpp/blob/master/LICENCE) [![Downloads](https://img.shields.io/github/downloads/muflihun/easyloggingpp/total.svg)](https://github.com/muflihun/easyloggingpp/releases/latest) [![Donate](https://muflihun.github.io/donate.png?v2)](https://www.paypal.me/zuhd/25) ### Quick Links [![download] Latest Release](https://github.com/muflihun/easyloggingpp/releases/latest) [![notes] Changelog](/CHANGELOG.md) [![samples] Samples](/samples) --- ### Table of Contents
Overview
    Why yet another library
    Features at a glance
Getting Started
    Download
    Quick Start
    Install (Optional)
    Setting Application Arguments
Configuration
    Level
    Configure
        Using Configuration File
        Using el::Configurations Class
        Using In line Configurations
    Default Configurations
    Global Configurations
    Logging Format Specifiers
    Date/Time Format Specifiers
    Custom Format Specifiers
    Logging Flags
    Application Arguments
    Configuration Macros
    Reading Configurations
Logging
    Basic
    Conditional Logging
    Occasional Logging
    printf Like Logging
    Network Logging
    Verbose Logging
        Basic
        Conditional and Occasional
        Verbose Level
        Check If Verbose Logging Is On
        VModule
    Registering New Loggers
    Unregister Loggers
    Populating Existing Logger IDs
    Sharing Logging Repository
Extra Features
    Performance Tracking
        Conditional Performance Tracking
        Make Use of Performance Tracking Data
    Log File Rotating
    Crash Handling
        Installing Custom Crash Handlers
    Stacktrace
    Multi-threading
    CHECK Macros
    Logging perror()
    Using Syslog
    STL Logging
        Supported Templates
    Qt Logging
    Boost Logging
    wxWidgets Logging
    Extending Library
        Logging Your Own Class
        Logging Third-party Class
    Manually Flushing and Rolling Log Files
    Log Dispatch Callback
    Logger Registration Callback
    Asynchronous Logging
    Helper Classes
Contribution
    Submitting Patches
    Reporting a Bug
Compatibility
    Build Matrix
Licence
Disclaimer
# Overview Easylogging++ is single header efficient logging library for C++ applications. It is extremely powerful, highly extendable and configurable to user's requirements. It provides ability to [write your own _sinks_](/samples/send-to-network) (via featured referred as `LogDispatchCallback`). This library is currently used by [hundreds of open-source projects on github](https://github.com/search?q=%22easylogging%2B%2B.h%22&type=Code&utf8=%E2%9C%93) and other open-source source control management sites. This manual is for Easylogging++ v9.96.7. For other versions please refer to corresponding [release](https://github.com/muflihun/easyloggingpp/releases) on github. > You may also be interested in [Residue](https://github.com/muflihun/residue/) logging server. [![top] Goto Top](#table-of-contents) ### Why yet another library If you are working on a small utility or large project in C++, this library can be handy. Its based on single header and only requires to link to single source file. (Originally it was header-only and was changed to use source file in [issue #445](https://github.com/muflihun/easyloggingpp/issues/445). You can still use header-only in [v9.89](https://github.com/muflihun/easyloggingpp/releases/tag/9.89)). This library has been designed with various thoughts in mind (i.e, portability, performance, usability, features and easy to setup). Why yet another library? Well, answer is pretty straight forward, use it as you wrote it so you can fix issues (if any) as you go or raise them on github. In addition to that, I personally have not seen any logging library based on single-header with such a design where you can configure on the go, extend it to your needs and get fast performance. I have seen other single-header logging libraries for C++ but either they use external libraries, e.g, boost or Qt to support certain features like threading, regular expression or date etc. This library has everything built-in to prevent usage of external libraries, not that I don't like those libraries, in fact I love them, but because not all projects use these libraries, I couldn't take risk of depending on them. [![top] Goto Top](#table-of-contents) ### Features at a glance Easylogging++ is feature-rich containing many features that both typical and advanced developer will require while writing a software; * [Highly configurable](#configuration) * [Extendable](#extending-library) * Extremely fast * [Thread](#multi-threading) and type safe * [Cross-platform](#compatibility) * [Custom log patterns](#logging-format-specifiers) * [Conditional and occasional logging](#conditional-logging) * [Performance tracking](#performance-tracking) * [Verbose logging](#verbose-logging) * [Crash handling](#crash-handling) * [Helper CHECK macros](#check-macros) * [STL logging](#stl-logging) * [Send to Syslog](#syslog) * [Third-party library logging (Qt, boost, wxWidgets etc)](#logging-third-party-class) * [Extensible (Logging your own class or third-party class)](#logging-your-own-class) * [And many more...](#extra-features) [![top] Goto Top](#table-of-contents) # Getting Started ### Download Download latest version from [Latest Release](https://github.com/muflihun/easyloggingpp/releases/latest) For other releases, please visit [releases page](https://github.com/muflihun/easyloggingpp/releases). If you application does not support C++11, please consider using [v8.91](https://github.com/muflihun/easyloggingpp/tree/v8.91). This is stable version for C++98 and C++03, just lack some features. [![top] Goto Top](#table-of-contents) ### Quick Start In order to get started with Easylogging++, you can follow three easy steps: * Download latest version * Include into your project (`easylogging++.h` and `easylogging++.cc`) * Initialize using single macro... and off you go! ```c++ #include "easylogging++.h" INITIALIZE_EASYLOGGINGPP int main(int argc, char* argv[]) { LOG(INFO) << "My first info log using default logger"; return 0; } ``` Now compile using ``` g++ main.cc easylogging++.cc -o prog -std=c++11 ``` That simple! Please note that `INITIALIZE_EASYLOGGINGPP` should be used once and once-only otherwise you will end up getting compilation errors. This is definiting several `extern` variables. This means it can be defined only once per application. Best place to put this initialization statement is in file where `int main(int, char**)` function is defined, right after last include statement. ### Install (Optional) If you want to install this header system-wide, you can do so via: ``` mkdir build cd build cmake -Dtest=ON ../ make make test make install ``` Following options are supported by Easylogging++ cmake and you can turn these options on using `-D