Skip to content

easyloggingpp: add new options #27349

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

chausner
Copy link
Contributor

@chausner chausner commented May 2, 2025

Summary

Changes to recipe: easyloggingpp/9.97.1

Motivation

The current recipe only offers a small subset of the many options offered by the library, see https://github.com/abumq/easyloggingpp?tab=readme-ov-file#configuration-macros.

This PR adds a subset of the remaining options that were previously not available in the recipe.

It also updates the GitHub repository URL. The old URL redirects to the new one.

Details

The following additional options are proposed to be added:

Package option Preprocessor macro Description
enable_unicode ELPP_UNICODE Enables Unicode logging support.
use_winsock2 ELPP_WINSOCK2 Uses winsock2 header instead of winsock. winsock and winsock2 cannot be mixed in a project. If the consumer application uses winsock2 elsewhere, easylogging++ must use winsock2, as well.
force_use_std_thread ELPP_FORCE_USE_STD_THREAD Always use std::thread over pthreads.
enable_debug_assert_failure ELPP_DEBUG_ASSERT_FAILURE Intended for debugging purposes to show assertion failurs.
enable_default_crash_handling !ELPP_DISABLE_DEFAULT_CRASH_HANDLING The default crash handler may not be desired, this allows it to be deactivated.
enable_fresh_logfile ELPP_FRESH_LOG_FILE Overwrite logs instead of appending them.
disable_log_to_file ELPP_NO_LOG_TO_FILE By default, easylogging++ logs to a file. This allows to disable it.
disable_custom_format_specifiers ELPP_DISABLE_CUSTOM_FORMAT_SPECIFIERS Disables custom format specifiers.
disable_logging_flags_from_arg ELPP_DISABLE_LOGGING_FLAGS_FROM_ARG Disables ability to change logging flags via command-line args.
disable_log_file_from_arg ELPP_DISABLE_LOG_FILE_FROM_ARG Disables ability to change the log file name via command-line args.
disable_check_macros ELPP_NO_CHECK_MACROS By default, easylogging++ defines a set of CHECK macros. If those are not needed or clash with other macros, this disables them.
disable_debug_macros ELPP_NO_DEBUG_MACROS By default, easylogging++ defines a set of DEBUG macros. If those are not needed or clash with other macros, this disables them.
disable_global_lock ELPP_NO_GLOBAL_LOCK Disables a lock that reduces performance overhead but can lead to problems in some cases.

Some of these may only be useful in very specific cases or for debugging. If you prefer not adding so many options, I suggest to at least go with these:

  • enable_unicode
  • use_winsock2
  • enable_default_crash_handling

These are the ones that I personally require in a project. I included the other options in this PR because I thought other library users may want to use them but I am okay to leave them out if you prefer.

This PR has been split off #27261.


@chausner
Copy link
Contributor Author

chausner commented May 2, 2025

Compilation log where I flipped all added options to their non-default value:

PS E:\Repos\conan-center-index\recipes\easyloggingpp\all\test_package> conan test . easyloggingpp/9.97.1 --build=missing `
>>     -o easyloggingpp/*:enable_unicode=True `
>>     -o easyloggingpp/*:use_winsock2=True `
>>     -o easyloggingpp/*:force_use_std_thread=True `
>>     -o easyloggingpp/*:enable_crash_log=True `
>>     -o easyloggingpp/*:enable_thread_safe=True `
>>     -o easyloggingpp/*:enable_debug_assert_failure=True `
>>     -o easyloggingpp/*:enable_debug_errors=True `
>>     -o easyloggingpp/*:enable_default_logfile=False `
>>     -o easyloggingpp/*:enable_default_crash_handling=False `
>>     -o easyloggingpp/*:enable_fresh_logfile=True `
>>     -o easyloggingpp/*:disable_logs=True `
>>     -o easyloggingpp/*:disable_debug_logs=True `
>>     -o easyloggingpp/*:disable_info_logs=True `
>>     -o easyloggingpp/*:disable_warning_logs=True `
>>     -o easyloggingpp/*:disable_error_logs=True `
>>     -o easyloggingpp/*:disable_fatal_logs=True `
>>     -o easyloggingpp/*:disable_verbose_logs=True `
>>     -o easyloggingpp/*:disable_trace_logs=True `
>>     -o easyloggingpp/*:disable_log_to_file=True `
>>     -o easyloggingpp/*:disable_custom_format_specifiers=True `
>>     -o easyloggingpp/*:disable_logging_flags_from_arg=True `
>>     -o easyloggingpp/*:disable_log_file_from_arg=True `
>>     -o easyloggingpp/*:disable_check_macros=True `
>>     -o easyloggingpp/*:disable_debug_macros=True `
>>     -o easyloggingpp/*:disable_global_lock=True `
>>     -o easyloggingpp/*:lib_utc_datetime=True

======== Input profiles ========
Profile host:
[settings]
arch=x86_64
build_type=Release
compiler=msvc
compiler.cppstd=14
compiler.runtime=dynamic
compiler.runtime_type=Release
compiler.version=193
os=Windows
[options]
easyloggingpp/*:disable_check_macros=True
easyloggingpp/*:disable_custom_format_specifiers=True
easyloggingpp/*:disable_debug_logs=True
easyloggingpp/*:disable_debug_macros=True
easyloggingpp/*:disable_error_logs=True
easyloggingpp/*:disable_fatal_logs=True
easyloggingpp/*:disable_global_lock=True
easyloggingpp/*:disable_info_logs=True
easyloggingpp/*:disable_log_file_from_arg=True
easyloggingpp/*:disable_log_to_file=True
easyloggingpp/*:disable_logging_flags_from_arg=True
easyloggingpp/*:disable_logs=True
easyloggingpp/*:disable_trace_logs=True
easyloggingpp/*:disable_verbose_logs=True
easyloggingpp/*:disable_warning_logs=True
easyloggingpp/*:enable_crash_log=True
easyloggingpp/*:enable_debug_assert_failure=True
easyloggingpp/*:enable_debug_errors=True
easyloggingpp/*:enable_default_crash_handling=False
easyloggingpp/*:enable_default_logfile=False
easyloggingpp/*:enable_fresh_logfile=True
easyloggingpp/*:enable_thread_safe=True
easyloggingpp/*:enable_unicode=True
easyloggingpp/*:force_use_std_thread=True
easyloggingpp/*:lib_utc_datetime=True
easyloggingpp/*:use_winsock2=True
[conf]


Profile build:
[settings]
arch=x86_64
build_type=Release
compiler=msvc
compiler.cppstd=14
compiler.runtime=dynamic
compiler.runtime_type=Release
compiler.version=193
os=Windows
[conf]



======== Launching test_package ========

======== Computing dependency graph ========
Graph root
    easyloggingpp/9.97.1 (test package): E:\Repos\conan-center-index\recipes\easyloggingpp\all\test_package\conanfile.py
Requirements
    easyloggingpp/9.97.1#19ed0bcb96cbeff0e5c141a749ce4af1 - Cache

======== Computing necessary packages ========
Connecting to remote 'conancenter' anonymously
easyloggingpp/9.97.1: Main binary package '7f39088068c04d4de02c1857e949b0b98dd8eae7' missing
easyloggingpp/9.97.1: Checking 3 compatible configurations
easyloggingpp/9.97.1: Compatible configurations not found in cache, checking servers
easyloggingpp/9.97.1: '00a01c1c39f367a59e459a2cb1fa746c4e12f20c': compiler.cppstd=17
easyloggingpp/9.97.1: '69fb2e54d313d080a02e94cfdad6de6c1187e72b': compiler.cppstd=20
easyloggingpp/9.97.1: '6068f58b9588552ce7e8f41fe1a88b45e1170dab': compiler.cppstd=23
Requirements
    easyloggingpp/9.97.1#19ed0bcb96cbeff0e5c141a749ce4af1:7f39088068c04d4de02c1857e949b0b98dd8eae7 - Build

======== Installing packages ========

-------- Installing package easyloggingpp/9.97.1 (1 of 1) --------
easyloggingpp/9.97.1: Building from source
easyloggingpp/9.97.1: Package easyloggingpp/9.97.1:7f39088068c04d4de02c1857e949b0b98dd8eae7
easyloggingpp/9.97.1: Copying sources to build folder
easyloggingpp/9.97.1: Building your package in E:\Packages\conan\b\easylfb831aed795e6\b
easyloggingpp/9.97.1: Calling generate()
easyloggingpp/9.97.1: Generators folder: E:\Packages\conan\b\easylfb831aed795e6\b\build\generators
easyloggingpp/9.97.1: CMakeToolchain generated: conan_toolchain.cmake
easyloggingpp/9.97.1: CMakeToolchain generated: E:\Packages\conan\b\easylfb831aed795e6\b\build\generators\CMakePresets.json
easyloggingpp/9.97.1: CMakeToolchain generated: E:\Packages\conan\b\easylfb831aed795e6\b\src\CMakeUserPresets.json
easyloggingpp/9.97.1: Generating aggregated env files
easyloggingpp/9.97.1: Generated aggregated env files: ['conanbuild.bat', 'conanrun.bat']
easyloggingpp/9.97.1: Calling build()
easyloggingpp/9.97.1: Running CMake.configure()
easyloggingpp/9.97.1: RUN: cmake -G "Visual Studio 17 2022" -DCMAKE_TOOLCHAIN_FILE="generators/conan_toolchain.cmake" -DCMAKE_INSTALL_PREFIX="E:/Packages/conan/b/easylfb831aed795e6/p" -DCMAKE_POLICY_DEFAULT_CMP0091="NEW" "E:/Packages/conan/b/easylfb831aed795e6/b/src"
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 3.10 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value.  Or, use the <min>...<max> syntax
  to tell CMake that the project requires at least <min> but has been updated
  to work with policies introduced by <max> or earlier.


-- Using Conan toolchain: E:/Packages/conan/b/easylfb831aed795e6/b/build/generators/conan_toolchain.cmake
-- Conan toolchain: CMAKE_GENERATOR_TOOLSET=v143
-- Conan toolchain: Setting CMAKE_MSVC_RUNTIME_LIBRARY=$<$<CONFIG:Release>:MultiThreadedDLL>
-- Conan toolchain: C++ Standard 14 with extensions OFF
-- Selecting Windows SDK version 10.0.26100.0 to target Windows 10.0.26120.
-- The CXX compiler identification is MSVC 19.43.34810.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.43.34808/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for C++ include execinfo.h
-- Looking for C++ include execinfo.h - not found
-- Setting C++14
-- Configuring done (9.0s)
-- Generating done (0.0s)
-- Build files have been written to: E:/Packages/conan/b/easylfb831aed795e6/b/build

easyloggingpp/9.97.1: Running CMake.build()
easyloggingpp/9.97.1: RUN: cmake --build "E:\Packages\conan\b\easylfb831aed795e6\b\build" --config Release
MSBuild-Version 17.13.19+0d9f5a35a für .NET Framework

  1>Checking Build System
  Building Custom Rule E:/Packages/conan/b/easylfb831aed795e6/b/src/CMakeLists.txt
  easylogging++.cc
  Stack trace not available for this compiler
E:\Packages\conan\b\easylfb831aed795e6\b\src\src\easylogging++.cc(2653,25): warning C4101: "ex": Unreferenzierte lokale Variable [E:\Packages\conan\b\easylfb831aed795e6\b\build\easyloggingpp.vcxproj]
  easyloggingpp.vcxproj -> E:\Packages\conan\b\easylfb831aed795e6\b\build\Release\easyloggingpp.lib
  Building Custom Rule E:/Packages/conan/b/easylfb831aed795e6/b/src/CMakeLists.txt

easyloggingpp/9.97.1: Package '7f39088068c04d4de02c1857e949b0b98dd8eae7' built
easyloggingpp/9.97.1: Build folder E:\Packages\conan\b\easylfb831aed795e6\b\build
easyloggingpp/9.97.1: Generating the package
easyloggingpp/9.97.1: Packaging in folder E:\Packages\conan\b\easylfb831aed795e6\p
easyloggingpp/9.97.1: Calling package()
easyloggingpp/9.97.1: Running CMake.install()
easyloggingpp/9.97.1: RUN: cmake --install "E:\Packages\conan\b\easylfb831aed795e6\b\build" --config Release --prefix "E:/Packages/conan/b/easylfb831aed795e6/p"
-- Installing: E:/Packages/conan/b/easylfb831aed795e6/p/include/easylogging++.h
-- Installing: E:/Packages/conan/b/easylfb831aed795e6/p/include/easylogging++.cc
-- Installing: E:/Packages/conan/b/easylfb831aed795e6/p/share/pkgconfig/easyloggingpp.pc
-- Installing: E:/Packages/conan/b/easylfb831aed795e6/p/lib/easyloggingpp.lib

easyloggingpp/9.97.1: package(): Packaged 1 '.cc' file: easylogging++.cc
easyloggingpp/9.97.1: package(): Packaged 1 '.h' file: easylogging++.h
easyloggingpp/9.97.1: package(): Packaged 1 '.lib' file: easyloggingpp.lib
easyloggingpp/9.97.1: package(): Packaged 1 file: LICENSE
easyloggingpp/9.97.1: Created package revision 0f52e3fad873544ff83e2f2d790c4f11
easyloggingpp/9.97.1: Package '7f39088068c04d4de02c1857e949b0b98dd8eae7' created
easyloggingpp/9.97.1: Full package reference: easyloggingpp/9.97.1#19ed0bcb96cbeff0e5c141a749ce4af1:7f39088068c04d4de02c1857e949b0b98dd8eae7#0f52e3fad873544ff83e2f2d790c4f11
easyloggingpp/9.97.1: Package folder E:\Packages\conan\b\easylfb831aed795e6\p

======== Testing the package ========
Removing previously existing 'test_package' build folder: E:\Repos\conan-center-index\recipes\easyloggingpp\all\test_package\build\msvc-193-x86_64-14-release
easyloggingpp/9.97.1 (test package): Test package build: build\msvc-193-x86_64-14-release
easyloggingpp/9.97.1 (test package): Test package build folder: E:\Repos\conan-center-index\recipes\easyloggingpp\all\test_package\build\msvc-193-x86_64-14-release
easyloggingpp/9.97.1 (test package): Writing generators to E:\Repos\conan-center-index\recipes\easyloggingpp\all\test_package\build\msvc-193-x86_64-14-release\generators
easyloggingpp/9.97.1 (test package): Generator 'CMakeDeps' calling 'generate()'
easyloggingpp/9.97.1 (test package): CMakeDeps necessary find_package() and targets for your CMakeLists.txt
    find_package(easyloggingpp)
    target_link_libraries(... easyloggingpp::easyloggingpp)
easyloggingpp/9.97.1 (test package): Generator 'CMakeToolchain' calling 'generate()'
easyloggingpp/9.97.1 (test package): CMakeToolchain generated: conan_toolchain.cmake
easyloggingpp/9.97.1 (test package): CMakeToolchain generated: E:\Repos\conan-center-index\recipes\easyloggingpp\all\test_package\build\msvc-193-x86_64-14-release\generators\CMakePresets.json
easyloggingpp/9.97.1 (test package): CMakeToolchain generated: E:\Repos\conan-center-index\recipes\easyloggingpp\all\test_package\CMakeUserPresets.json
easyloggingpp/9.97.1 (test package): Generator 'VirtualRunEnv' calling 'generate()'
easyloggingpp/9.97.1 (test package): Generating aggregated env files
easyloggingpp/9.97.1 (test package): Generated aggregated env files: ['conanrun.bat', 'conanbuild.bat']

======== Testing the package: Building ========
easyloggingpp/9.97.1 (test package): Calling build()
easyloggingpp/9.97.1 (test package): Running CMake.configure()
easyloggingpp/9.97.1 (test package): RUN: cmake -G "Visual Studio 17 2022" -DCMAKE_TOOLCHAIN_FILE="generators/conan_toolchain.cmake" -DCMAKE_INSTALL_PREFIX="E:/Repos/conan-center-index/recipes/easyloggingpp/all/test_package" -DCMAKE_POLICY_DEFAULT_CMP0091="NEW" "E:/Repos/conan-center-index/recipes/easyloggingpp/all/test_package"
-- Using Conan toolchain: E:/Repos/conan-center-index/recipes/easyloggingpp/all/test_package/build/msvc-193-x86_64-14-release/generators/conan_toolchain.cmake
-- Conan toolchain: CMAKE_GENERATOR_TOOLSET=v143
-- Conan toolchain: Setting CMAKE_MSVC_RUNTIME_LIBRARY=$<$<CONFIG:Release>:MultiThreadedDLL>
-- Conan toolchain: C++ Standard 14 with extensions OFF
-- Selecting Windows SDK version 10.0.26100.0 to target Windows 10.0.26120.
-- The CXX compiler identification is MSVC 19.43.34810.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.43.34808/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Conan: Target declared 'easyloggingpp::easyloggingpp'
-- Configuring done (7.3s)
-- Generating done (0.0s)
-- Build files have been written to: E:/Repos/conan-center-index/recipes/easyloggingpp/all/test_package/build/msvc-193-x86_64-14-release

easyloggingpp/9.97.1 (test package): Running CMake.build()
easyloggingpp/9.97.1 (test package): RUN: cmake --build "E:\Repos\conan-center-index\recipes\easyloggingpp\all\test_package\build\msvc-193-x86_64-14-release" --config Release
MSBuild-Version 17.13.19+0d9f5a35a für .NET Framework

  1>Checking Build System
  Building Custom Rule E:/Repos/conan-center-index/recipes/easyloggingpp/all/test_package/CMakeLists.txt
  test_package.cpp
  Stack trace not available for this compiler
  test_package.vcxproj -> E:\Repos\conan-center-index\recipes\easyloggingpp\all\test_package\build\msvc-193-x86_64-14-release\Release\test_package.exe
  Building Custom Rule E:/Repos/conan-center-index/recipes/easyloggingpp/all/test_package/CMakeLists.txt


======== Testing the package: Executing test ========
easyloggingpp/9.97.1 (test package): Running test()
easyloggingpp/9.97.1 (test package): RUN: Release\test_package

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant