Commit Graph

4705 Commits

Author SHA1 Message Date
M4rFri
85a05357ae fixed some rebase errors 2025-02-11 11:26:43 +01:00
Felix Heitmann
ef054062c4 Test attributes: fixing wrongful lambda capture
constexpr doesn't need to be captured. failed ci/cd
2025-02-11 10:17:01 +01:00
Felix Heitmann
7964f9ea9a fixing signed/unsigned in test attributes 2025-02-11 10:17:01 +01:00
Felix Heitmann
7394af7391 Attributes: use proper function for overwriting attributes 2025-02-11 10:17:00 +01:00
Felix Heitmann
838d6402bc Attribute tests: remove fmtlib from tests
Use the spdlog::fmt_lib wrapper instead.
2025-02-11 10:17:00 +01:00
Felix Heitmann
37d46472c5 Attributes include unit-tests 2025-02-11 10:17:00 +01:00
Felix Heitmann
1661e34a75 Attributes: scoped contexts
Oftentimes you want to put attributes into a logger (file names, ids, etc.) only for a specific scope (e.g. a function or an if-clause).

Creating a scoped-context will allow this, by returning an RAII-object that will remove the inserted keys upon destruction.
2025-02-11 10:17:00 +01:00
Felix Heitmann
774a10bbeb Attributes proper insertion overloads.
Previous functions were named poorly due to miscommunication between the devs.

All functions to put attributes on a logger are `put`.
2025-02-11 10:17:00 +01:00
Felix Heitmann
d5889bff8b Attributes: invert attr search logic 2025-02-11 10:17:00 +01:00
Felix Heitmann
7d421eb56c Attributes: moving to ordered map
Otherwise the attributes are printed in pseudo-random order.
2025-02-11 10:17:00 +01:00
Felix Heitmann
e8924a3d47 Attributes: Removing impact on logger
The logger interface should not be bloated by additional functionality. Reducing it to a nested call to `.attrs().put()` achieves the same nesting as `.put_attribute()` but requires a smaller interface change on the logger class.
2025-02-11 10:17:00 +01:00
M4rFri
ffec5f3c07 Added some unit tests 2025-02-11 10:17:00 +01:00
M4rFri
c3dac2fa5d Updated logger to accept and log attributes 2025-02-11 10:16:22 +01:00
M4rFri
f24c55016c Updated log_msg to accept attributes 2025-02-11 10:15:11 +01:00
M4rFri
d193833d4a Added attribute formatter 2025-02-11 10:11:51 +01:00
M4rFri
653bee4659 Added attributes 2025-02-11 10:08:05 +01:00
gabime
22405cf9ae Fixed async bench
Some checks failed
linux / ${{ matrix.config.compiler}} ${{ matrix.config.version }} (C++${{ matrix.config.cppstd }} ${{ matrix.config.build_type }} ${{ matrix.config.asan == 'ON' && 'ASAN' || '' }}${{ matrix.config.tsan == 'ON' && 'TSAN' || '' }}) (map[asan:ON build_type:Debug … (push) Has been cancelled
linux / ${{ matrix.config.compiler}} ${{ matrix.config.version }} (C++${{ matrix.config.cppstd }} ${{ matrix.config.build_type }} ${{ matrix.config.asan == 'ON' && 'ASAN' || '' }}${{ matrix.config.tsan == 'ON' && 'TSAN' || '' }}) (map[build_type:Debug compiler… (push) Has been cancelled
linux / ${{ matrix.config.compiler}} ${{ matrix.config.version }} (C++${{ matrix.config.cppstd }} ${{ matrix.config.build_type }} ${{ matrix.config.asan == 'ON' && 'ASAN' || '' }}${{ matrix.config.tsan == 'ON' && 'TSAN' || '' }}) (map[build_type:Release compil… (push) Has been cancelled
macos / macOS Clang (C++17, Release) (push) Has been cancelled
windows / build (map[BUILD_EXAMPLE:OFF BUILD_SHARED:ON BUILD_TYPE:Release CXX_STANDARD:17 FATAL_ERRORS:ON GENERATOR:Visual Studio 17 2022]) (push) Has been cancelled
windows / build (map[BUILD_EXAMPLE:OFF BUILD_SHARED:ON BUILD_TYPE:Release CXX_STANDARD:20 FATAL_ERRORS:ON GENERATOR:Visual Studio 17 2022]) (push) Has been cancelled
windows / build (map[BUILD_EXAMPLE:ON BUILD_SHARED:OFF BUILD_TYPE:Release CXX_STANDARD:17 FATAL_ERRORS:ON GENERATOR:Visual Studio 17 2022]) (push) Has been cancelled
windows / build_2019 (map[BUILD_EXAMPLE:ON BUILD_SHARED:ON BUILD_TYPE:Release CXX_STANDARD:17 FATAL_ERRORS:ON GENERATOR:Visual Studio 16 2019]) (push) Has been cancelled
windows / build_2019 (map[BUILD_EXAMPLE:ON BUILD_SHARED:ON BUILD_TYPE:Release CXX_STANDARD:20 FATAL_ERRORS:ON GENERATOR:Visual Studio 16 2019]) (push) Has been cancelled
2025-02-01 19:23:23 +02:00
gabime
27d8580131 Bump fmt to version 11.1.3 2025-02-01 19:06:19 +02:00
gabime
fbffd38030 CMakeLists.txt format 2025-02-01 19:03:41 +02:00
gabime
3a54caee36 CMakeLists.txt format 2025-02-01 19:02:52 +02:00
gabime
9db0ba648a Refactor SPDLOG_API define
Some checks failed
linux / ${{ matrix.config.compiler}} ${{ matrix.config.version }} (C++${{ matrix.config.cppstd }} ${{ matrix.config.build_type }} ${{ matrix.config.asan == 'ON' && 'ASAN' || '' }}${{ matrix.config.tsan == 'ON' && 'TSAN' || '' }}) (map[asan:ON build_type:Debug … (push) Failing after 3s
linux / ${{ matrix.config.compiler}} ${{ matrix.config.version }} (C++${{ matrix.config.cppstd }} ${{ matrix.config.build_type }} ${{ matrix.config.asan == 'ON' && 'ASAN' || '' }}${{ matrix.config.tsan == 'ON' && 'TSAN' || '' }}) (map[build_type:Debug compiler… (push) Failing after 2s
linux / ${{ matrix.config.compiler}} ${{ matrix.config.version }} (C++${{ matrix.config.cppstd }} ${{ matrix.config.build_type }} ${{ matrix.config.asan == 'ON' && 'ASAN' || '' }}${{ matrix.config.tsan == 'ON' && 'TSAN' || '' }}) (map[build_type:Release compil… (push) Failing after 2s
macos / macOS Clang (C++17, Release) (push) Has been cancelled
windows / build (map[BUILD_EXAMPLE:OFF BUILD_SHARED:ON BUILD_TYPE:Release CXX_STANDARD:17 FATAL_ERRORS:ON GENERATOR:Visual Studio 17 2022]) (push) Has been cancelled
windows / build (map[BUILD_EXAMPLE:OFF BUILD_SHARED:ON BUILD_TYPE:Release CXX_STANDARD:20 FATAL_ERRORS:ON GENERATOR:Visual Studio 17 2022]) (push) Has been cancelled
windows / build (map[BUILD_EXAMPLE:ON BUILD_SHARED:OFF BUILD_TYPE:Release CXX_STANDARD:17 FATAL_ERRORS:ON GENERATOR:Visual Studio 17 2022]) (push) Has been cancelled
windows / build_2019 (map[BUILD_EXAMPLE:ON BUILD_SHARED:ON BUILD_TYPE:Release CXX_STANDARD:17 FATAL_ERRORS:ON GENERATOR:Visual Studio 16 2019]) (push) Has been cancelled
windows / build_2019 (map[BUILD_EXAMPLE:ON BUILD_SHARED:ON BUILD_TYPE:Release CXX_STANDARD:20 FATAL_ERRORS:ON GENERATOR:Visual Studio 16 2019]) (push) Has been cancelled
2025-01-18 20:32:34 +02:00
gabime
463e41f049 Refactor exporing in common.h 2025-01-18 19:45:13 +02:00
gabime
ace82f7da6 Try fix windows link error with visiblity 2025-01-18 19:17:45 +02:00
gabime
b93c0f8e8d Update comment 2025-01-18 16:37:18 +02:00
gabime
aec733b7a9 change async queue limits to constexpr 2025-01-18 16:29:14 +02:00
gabime
eb660caa6c Limit max async queue size to 250,000 entries 2025-01-18 16:26:43 +02:00
gabime
af8440b248 Small clean of enqueue_if_have_room in mpmc_blocking_q.h 2025-01-18 16:04:31 +02:00
gabime
214e26e8b2 Make err_helper time printing more robust 2025-01-18 14:09:19 +02:00
gabime
35060923d9 improved err_helper message while catching exceptions
Some checks failed
macos / macOS Clang (C++17, Release) (push) Waiting to run
windows / build (map[BUILD_EXAMPLE:OFF BUILD_SHARED:ON BUILD_TYPE:Release CXX_STANDARD:17 FATAL_ERRORS:ON GENERATOR:Visual Studio 17 2022]) (push) Waiting to run
windows / build (map[BUILD_EXAMPLE:OFF BUILD_SHARED:ON BUILD_TYPE:Release CXX_STANDARD:20 FATAL_ERRORS:ON GENERATOR:Visual Studio 17 2022]) (push) Waiting to run
windows / build (map[BUILD_EXAMPLE:ON BUILD_SHARED:OFF BUILD_TYPE:Release CXX_STANDARD:17 FATAL_ERRORS:ON GENERATOR:Visual Studio 17 2022]) (push) Waiting to run
windows / build_2019 (map[BUILD_EXAMPLE:ON BUILD_SHARED:ON BUILD_TYPE:Release CXX_STANDARD:17 FATAL_ERRORS:ON GENERATOR:Visual Studio 16 2019]) (push) Waiting to run
windows / build_2019 (map[BUILD_EXAMPLE:ON BUILD_SHARED:ON BUILD_TYPE:Release CXX_STANDARD:20 FATAL_ERRORS:ON GENERATOR:Visual Studio 16 2019]) (push) Waiting to run
linux / ${{ matrix.config.compiler}} ${{ matrix.config.version }} (C++${{ matrix.config.cppstd }} ${{ matrix.config.build_type }} ${{ matrix.config.asan == 'ON' && 'ASAN' || '' }}${{ matrix.config.tsan == 'ON' && 'TSAN' || '' }}) (map[asan:ON build_type:Debug … (push) Failing after 3s
linux / ${{ matrix.config.compiler}} ${{ matrix.config.version }} (C++${{ matrix.config.cppstd }} ${{ matrix.config.build_type }} ${{ matrix.config.asan == 'ON' && 'ASAN' || '' }}${{ matrix.config.tsan == 'ON' && 'TSAN' || '' }}) (map[build_type:Debug compiler… (push) Failing after 2s
linux / ${{ matrix.config.compiler}} ${{ matrix.config.version }} (C++${{ matrix.config.cppstd }} ${{ matrix.config.build_type }} ${{ matrix.config.asan == 'ON' && 'ASAN' || '' }}${{ matrix.config.tsan == 'ON' && 'TSAN' || '' }}) (map[build_type:Release compil… (push) Failing after 3s
2025-01-18 13:42:55 +02:00
gabime
a8e7527d2d Merge branch 'v2.x' of github.com:gabime/spdlog into v2.x 2025-01-18 13:41:00 +02:00
Gabi Melman
2abfa1628b
Gabime/visibilty-hidden 2.x (#3324)
Set CMAKE_CXX_VISIBILITY_PRESET and VISIBILITY_INLINES_HIDDEN when build shared lib
2025-01-18 13:36:01 +02:00
gabime
d6389d696e Fixed analyzer warnings in ansicolor_sink.cpp 2025-01-18 11:42:04 +02:00
gabime
c563b62aea Refactor ansicolor_sink.cpp 2025-01-18 11:40:38 +02:00
Gabi Melman
e3f8349d0c
Add missing locks to ansicolor_sink.cpp 2025-01-18 07:32:30 +02:00
Gabi Melman
128a9fcc49
Update test_async.cpp
Some checks failed
macos / macOS Clang (C++17, Release) (push) Waiting to run
windows / build (map[BUILD_EXAMPLE:OFF BUILD_SHARED:ON BUILD_TYPE:Release CXX_STANDARD:17 FATAL_ERRORS:ON GENERATOR:Visual Studio 17 2022]) (push) Waiting to run
windows / build (map[BUILD_EXAMPLE:OFF BUILD_SHARED:ON BUILD_TYPE:Release CXX_STANDARD:20 FATAL_ERRORS:ON GENERATOR:Visual Studio 17 2022]) (push) Waiting to run
windows / build (map[BUILD_EXAMPLE:ON BUILD_SHARED:OFF BUILD_TYPE:Release CXX_STANDARD:17 FATAL_ERRORS:ON GENERATOR:Visual Studio 17 2022]) (push) Waiting to run
windows / build_2019 (map[BUILD_EXAMPLE:ON BUILD_SHARED:ON BUILD_TYPE:Release CXX_STANDARD:17 FATAL_ERRORS:ON GENERATOR:Visual Studio 16 2019]) (push) Waiting to run
windows / build_2019 (map[BUILD_EXAMPLE:ON BUILD_SHARED:ON BUILD_TYPE:Release CXX_STANDARD:20 FATAL_ERRORS:ON GENERATOR:Visual Studio 16 2019]) (push) Waiting to run
linux / ${{ matrix.config.compiler}} ${{ matrix.config.version }} (C++${{ matrix.config.cppstd }} ${{ matrix.config.build_type }} ${{ matrix.config.asan == 'ON' && 'ASAN' || '' }}${{ matrix.config.tsan == 'ON' && 'TSAN' || '' }}) (map[asan:ON build_type:Debug … (push) Failing after 12s
linux / ${{ matrix.config.compiler}} ${{ matrix.config.version }} (C++${{ matrix.config.cppstd }} ${{ matrix.config.build_type }} ${{ matrix.config.asan == 'ON' && 'ASAN' || '' }}${{ matrix.config.tsan == 'ON' && 'TSAN' || '' }}) (map[build_type:Debug compiler… (push) Failing after 16m51s
linux / ${{ matrix.config.compiler}} ${{ matrix.config.version }} (C++${{ matrix.config.cppstd }} ${{ matrix.config.build_type }} ${{ matrix.config.asan == 'ON' && 'ASAN' || '' }}${{ matrix.config.tsan == 'ON' && 'TSAN' || '' }}) (map[build_type:Release compil… (push) Failing after 3s
2025-01-17 23:18:33 +02:00
Gabi Melman
43812ddaf1
Update test_async.cpp 2025-01-17 23:17:35 +02:00
gabime
23b1c4c079 Revert "Small code removal"
This reverts commit b01f15cb26.
2025-01-17 22:35:23 +02:00
gabime
b01f15cb26 Small code removal 2025-01-17 22:34:09 +02:00
gabime
370dad3225 Use chrono literals in async tests 2025-01-17 22:25:28 +02:00
gabime
418a39f6ce Fixed test 2025-01-17 22:09:35 +02:00
gabime
177f2618fb Merge branch 'v2.x' of github.com:gabime/spdlog into v2.x 2025-01-17 22:06:23 +02:00
Gabi Melman
6a794b1dff
Update test_async.cpp 2025-01-17 22:02:43 +02:00
gabime
fbe626d828 code format 2025-01-17 21:01:54 +02:00
gabime
47fe6ef92a code format
Some checks failed
macos / macOS Clang (C++17, Release) (push) Waiting to run
windows / build (map[BUILD_EXAMPLE:OFF BUILD_SHARED:ON BUILD_TYPE:Release CXX_STANDARD:17 FATAL_ERRORS:ON GENERATOR:Visual Studio 17 2022]) (push) Waiting to run
windows / build (map[BUILD_EXAMPLE:OFF BUILD_SHARED:ON BUILD_TYPE:Release CXX_STANDARD:20 FATAL_ERRORS:ON GENERATOR:Visual Studio 17 2022]) (push) Waiting to run
windows / build (map[BUILD_EXAMPLE:ON BUILD_SHARED:OFF BUILD_TYPE:Release CXX_STANDARD:17 FATAL_ERRORS:ON GENERATOR:Visual Studio 17 2022]) (push) Waiting to run
windows / build_2019 (map[BUILD_EXAMPLE:ON BUILD_SHARED:ON BUILD_TYPE:Release CXX_STANDARD:17 FATAL_ERRORS:ON GENERATOR:Visual Studio 16 2019]) (push) Waiting to run
windows / build_2019 (map[BUILD_EXAMPLE:ON BUILD_SHARED:ON BUILD_TYPE:Release CXX_STANDARD:20 FATAL_ERRORS:ON GENERATOR:Visual Studio 16 2019]) (push) Waiting to run
linux / ${{ matrix.config.compiler}} ${{ matrix.config.version }} (C++${{ matrix.config.cppstd }} ${{ matrix.config.build_type }} ${{ matrix.config.asan == 'ON' && 'ASAN' || '' }}${{ matrix.config.tsan == 'ON' && 'TSAN' || '' }}) (map[asan:ON build_type:Debug … (push) Failing after 4s
linux / ${{ matrix.config.compiler}} ${{ matrix.config.version }} (C++${{ matrix.config.cppstd }} ${{ matrix.config.build_type }} ${{ matrix.config.asan == 'ON' && 'ASAN' || '' }}${{ matrix.config.tsan == 'ON' && 'TSAN' || '' }}) (map[build_type:Debug compiler… (push) Failing after 2s
linux / ${{ matrix.config.compiler}} ${{ matrix.config.version }} (C++${{ matrix.config.cppstd }} ${{ matrix.config.build_type }} ${{ matrix.config.asan == 'ON' && 'ASAN' || '' }}${{ matrix.config.tsan == 'ON' && 'TSAN' || '' }}) (map[build_type:Release compil… (push) Failing after 2s
2025-01-17 20:59:46 +02:00
gabime
b9f0243405 code format 2025-01-17 20:58:19 +02:00
gabime
873026a254 Pad level names in default pattern 2025-01-17 20:47:28 +02:00
gabime
e99e09eba7 Fixed global logger name 2025-01-17 20:26:47 +02:00
gabime
07be1b4767 Bump fmt version to 11.1.2 2025-01-17 20:07:12 +02:00
gabime
f00a6550fa Fixed some tidy warnings 2025-01-17 19:13:36 +02:00
gabime
391eb198bf Added copy and move tests 2025-01-17 19:06:24 +02:00