Commit Graph

4251 Commits

Author SHA1 Message Date
Uri Simchoni
f40233715e Hide non-API functions unconditionally 2023-10-10 10:28:01 +03:00
Uri Simchoni
894f26bd87 Hide non-API functions when position independent code is enabled
Usage of -fvisibility=hidden is the recommended default for DSO's.

If the spdlog build is for a shared library, then API symbols have
SPDLOG_API marking on them, and cause the symbol to be exported, with
other symbols now hidden by default.

If the build is for a static library with position-independent code, then
spdlog is to be embedded as implementation detail in another shared
library or executable. In that case we don't want to export any symbol.
Conveniently, SPDLPG_API in that case resolves to nothing, so with the
default of hidden all symbols are made hidden.
2023-10-09 22:51:14 +03:00
Gabi Melman
91807c2e71
Update README.md 2023-09-26 00:33:45 +03:00
Gabi Melman
d4a5fd564c
Update README.md 2023-09-26 00:33:32 +03:00
gabime
e5865186d4 Revert "Added a function to add callbacks that are called when a logger is registered (#2883)"
This reverts commit b6eeb7364c, since it causes deadlocks too easily for the users.
2023-09-25 20:53:45 +03:00
Jonathan Vannier
b6eeb7364c
Added a function to add callbacks that are called when a logger is registered (#2883)
* Added a function to add callbacks that are called when a logger is registered

* Fix non captured registration 2 not being properly tested for

* Replace std::list by std::vector

* Remove const refs to shared pointers

* Fix missing header
2023-09-25 18:49:04 +03:00
gabime
0a53eafe18 update clang format again 2023-09-25 16:40:36 +03:00
gabime
251c856a12 update clang format again 2023-09-25 16:40:26 +03:00
gabime
4b2a8219d5 reformat code 2023-09-25 16:20:42 +03:00
gabime
cafde8ccc1 updated clang format 2023-09-25 16:19:40 +03:00
gabime
9d52261185 clang format 2023-09-25 16:08:29 +03:00
gabime
230e15f499 updated format.sh 2023-09-25 16:07:56 +03:00
gabime
7f535d184e updated .clang-format 2023-09-25 16:06:08 +03:00
gabime
95c226e9c9 format 2023-09-25 05:05:25 +03:00
gabime
5e88d5fe22 Never sort includes in clang format 2023-09-25 05:03:54 +03:00
Gabi Melman
5931a3d6f8 Fixed windows compile 2023-09-25 04:58:45 +03:00
Gabi Melman
f4afd81ce6
Update common.h 2023-09-25 03:07:15 +03:00
gabime
1a0bfc7a89 clang format 2023-09-25 02:44:07 +03:00
gabime
f24f7fa2fa Added missing include mutex 2023-09-25 02:44:00 +03:00
gabime
65701f4d5b Updated format.sh script 2023-09-25 02:39:47 +03:00
gabime
9e36a15875 Updated clang format to google style 2023-09-25 02:37:17 +03:00
Gabi Melman
b9cb721b92
Update async_logger-inl.h 2023-09-22 02:42:37 +03:00
Gabi Melman
1d6dbc2a56
Fix code formatting of async_logger-inl.h 2023-09-22 02:42:00 +03:00
Yubin
b5b5043d42
Support async_overflow_policy::discard_new (#2876)
Reason for the discard_new policy: when there is an overflow, there
is usually some unexpected issue (a bug, or some other unexpected stuff).
And in case of unexpected issue, the first arrived log messages are usually
more important than subsequent ones. For example, some application
keep logging error messages in case of functionality failure, which,
when using async_overflow_policy::overrun_oldest, will overrun the
first arrived messages that may contain real reason for the failure.
2023-09-09 23:05:08 +03:00
gabime
d109e1dcd0 minor cleanup 2023-09-09 13:32:44 +03:00
gabime
a98d3ab0c7 clang format 2023-09-09 12:56:47 +03:00
neothenil
8014d6c31a
Fix encoding issue in qt_sinks (#2862)
Added support for utf8 in qt_color_sink
2023-09-09 12:52:10 +03:00
gabime
3aceda041b Fixed bench 2023-09-01 17:12:16 +03:00
gabime
7d0531b076 Removed policy_max from cmake_minimum_required(..) 2023-09-01 16:40:19 +03:00
Gabi Melman
47e04cf043
Update ci.yml 2023-08-31 00:29:17 +03:00
albert-github
81ce5fcdb7
Remove obsolete part from cmake configuration files (#2871)
Updating minimum CMake version to 3.11
2023-08-30 23:20:37 +03:00
mike
cedfeeb95f
Add SPDLOG_TO_VERSION to compare spdlog version (#2853)
You can use SPDLOG_VERSION to select the latest spdlog features
where available while falling back to older implementations otherwise.
Using SPDLOG_TO_VERSION() for the value to compare with is recommended.
for Example:
```c++
 void sink_it_(const details::log_msg &msg) override
 {
 #if SPDLOG_VERSION < SPDLOG_TO_VERSION(1,4,0)
     fmt::memory_buffer formatted;
 #else
     memory_buf_t formatted;
 #endif
     sinks::base_sink<Mutex>::formatter_->format(msg, formatted);
     // bala bala...
 }
```
2023-08-14 08:19:02 +03:00
Robert Maynard
2312489bdc
Provide spdlog_header_only in build directory export (#2846)
Fixes #2678
2023-08-07 23:25:21 +03:00
gabime
811bc4c7a9 Added another test for circular_q 2023-08-05 17:26:16 +03:00
gabime
1f8d36071e Fixed ci 2023-08-05 17:09:12 +03:00
gabime
bffceb90b0 Fixed circular_q size impl and added tests 2023-08-05 17:03:04 +03:00
moritz-h
371bc8ebe2
Set CMAKE_BUILD_TYPE only for single-config generators (#2839)
Thanks @moritz-h
2023-08-02 17:22:20 +03:00
xvitaly
2ee8bac78e
Added missing square bracket to fix the level_to_string_view test. (#2827) 2023-07-23 11:15:25 +03:00
Gabi Melman
d8d23a6606
Fix #2820 2023-07-21 00:37:03 +03:00
qwark
76dfc7e7c0
Qt Sink : Allow for darker colors (for light background). (#2817)
Default are too bright if background is light(white).
2023-07-14 20:21:25 +03:00
gabime
7e635fca68 Fixed #2724 by excluding bin_to_hex sink if using std::format 2023-07-08 17:12:25 +03:00
gabime
bed324e414 Formatted qt_sinks.h code 2023-07-08 15:27:16 +03:00
gabime
72a7ec3eb9 Bumped spdlog version to 1.12.0 2023-07-08 15:25:17 +03:00
gabime
64ed6b495c Revert "Fixed FMT_EXPORT to FMT_LIB_EXPORT in CMakeLists.txt"
This reverts commit c3fa8f60e2.
2023-07-08 13:44:27 +03:00
gabime
4338b9cd23 Revert "Updated bundled fmt to version 10.0.0"
This reverts commit 62e55e7a7f.
2023-07-08 13:23:40 +03:00
Gabi Melman
b73616ce29
Update README.md 2023-07-08 11:52:49 +03:00
Lucas Rangit MAGASWERAN
01b3724c48
sinks: android: handle when message is not loggable (#2801)
Android logger (since API 30) checks the per-tag property `log.tag.<tag>` to determine if a log message is loggable. See https://developer.android.com/ndk/reference/group/logging#__android_log_is_loggable . For example, `__android_log_buf_write` for a VERBOSE message will call `__android_log_is_loggable` and return `-EPERM` if the log message will not be printed because `log.tag.<tag>` is set to `INFO`.

Instead of erroring with the following error message, the Android sink should handle `-EPERM`. It is not an error to disable a log via the run-time property.

```
[*** LOG ERROR #0001 ***] [2023-06-29 00:50:26] [logcat] logging to Android failed: Unknown error -1 [/path/to/file.cpp(123)]
```
2023-07-07 00:24:06 +03:00
gabime
4b8ff51a29 Added const to put_newline() in bin_to_hex.h 2023-07-04 18:00:20 +03:00
Gabi Melman
8b8bc20f30
Added const qualifier to bin_hex_formatter to support c++20 2023-07-04 17:53:04 +03:00
gabime
3cd06a3d40 Added const qualifier to stopwatch formatter to support c++20 2023-07-04 16:04:49 +03:00