Commit Graph

2404 Commits

Author SHA1 Message Date
gabime
dcd5904bdc Updated clang-format
Merged with origin
2023-09-25 16:11:53 +03:00
gabime
6de0ffa15f Updated clang format to google style 2023-09-25 02:35:55 +03:00
gabime
66de161355 fix fwd 2023-09-25 02:20:13 +03:00
gabime
e28eadcd52 Clang format 2023-09-24 20:43:14 +03:00
gabime
2a1959c2ce wip static_only 2023-09-24 20:26:32 +03:00
gabime
cff3e27115 Removed usages of SPDLOG_COMPILED_LIB macro 2023-09-24 13:32:48 +03:00
gabime
6d520df916 Removed header only options 2023-09-24 13:27:26 +03:00
gabime
fc81e0390b Removed SPDLOG_COMPILED_LIB/HEADER_ONLY macros from common.h 2023-09-24 13:02:30 +03:00
gabime
b16a8951bc Added more [[nodiscard]] to functions in common 2023-09-24 11:53:04 +03:00
gabime
a34fb3761c Added nodiscard to level_to_number() 2023-09-24 11:50:24 +03:00
gabime
73eb6bc1f5 Replace static_cast with level_to_number in color sinks 2023-09-24 11:48:46 +03:00
Gabi Melman
7d3b5a1b10
Update wincolor_sink-inl.h 2023-09-23 18:45:36 +03:00
gabime
9a7448e4c8 Renamed to level_to_number 2023-09-23 18:21:27 +03:00
gabime
433cac487e Renamed spdlog::log_level to spdlog::level and added some level tests 2023-09-23 17:59:51 +03:00
gabime
7c0afada60 check SPDLOG_SOURCE_LOCATION in macros and in runtime 2023-09-23 02:03:48 +03:00
gabime
ea1c829764 fix warning 2023-09-23 01:53:03 +03:00
Gabi Melman
e315bcb2a9 Fix compilations in windows 2023-09-23 01:48:38 +03:00
gabime
e63d110baa use constexpr for colors in ansicolor_sink 2023-09-23 01:14:20 +03:00
gabime
5683d16b36 Fix atomic level 2023-09-23 00:55:47 +03:00
gabime
7d9cf59649 Fix atomic level 2023-09-23 00:46:15 +03:00
gabime
31a7dc6e1e Fix atomic level 2023-09-23 00:42:36 +03:00
gabime
3a405ba958 Fix atomic level 2023-09-23 00:30:24 +03:00
gabime
392917f855 null_atomic_log_level and fix compile 2023-09-23 00:27:32 +03:00
gabime
ac2955cb48 Use std::array for string levels storage 2023-09-22 23:20:54 +03:00
gabime
96bed42974 Clean level names logic and inline them 2023-09-22 21:38:04 +03:00
gabime
3d5ddea136 Use std::vformat 2023-09-22 18:24:45 +03:00
gabime
a3ef3ab7a4 Removed SPDLOG_FMT_STRING 2023-09-22 18:24:45 +03:00
gabime
b777497b0d Removed un needed inline specifier 2023-09-22 18:24:45 +03:00
gabime
5c93f5ff34 Revert last commit 2023-09-22 18:24:45 +03:00
gabime
9c1e1c85aa Removed un needed loc_with_fmt constructor 2023-09-22 18:24:45 +03:00
gabime
8488b027e9 Formatting 2023-09-22 18:24:45 +03:00
gabime
ad18d4e1cb Added missing include to <spdlog/fmt/xchar.h> 2023-09-22 18:24:45 +03:00
gabime
c0c1b49fa3 Fixed soruce location macro names 2023-09-22 18:24:45 +03:00
gabime
3979bd15f7 Fixed build 2023-09-22 18:24:45 +03:00
Gabi Melman
536da46a2c Changed macro name to SPDLOG_EMIT_SOURCE_LOCATION 2023-09-22 18:24:45 +03:00
Gabi Melman
ce6bccb194 Fixed logger::log with std::format under msvc 2023-09-22 18:24:45 +03:00
Gabi Melman
768de091ee Update common.h 2023-09-22 18:24:45 +03:00
Gabi Melman
2718d4671b Update common.h 2023-09-22 18:24:45 +03:00
Gabi Melman
e1c7e6fde4 Update logger.h 2023-09-22 18:24:45 +03:00
Gabi Melman
fb40b49ef0 Update logger.h 2023-09-22 18:24:45 +03:00
gabime
82069b2455 Fixed include <version> 2023-09-22 18:24:45 +03:00
gabime
5ae1ace844 Added loc_with_fmt overload with runtime_format_string 2023-09-22 18:24:45 +03:00
gabime
bcc24961a0 Added forgotten inline keywords 2023-09-22 18:24:45 +03:00
gabime
af2f24de07 Removed swap from logger and renamed source location macro to SPDLOG_USE_SOURCE_LOCATION 2023-09-22 18:24:45 +03:00
gabime
5882bfd0ad Simplify by replacing is_convertible_to_sv with string_view_t param 2023-09-22 18:24:45 +03:00
gabime
3eea04bcd3 Simplify by replacing is_convertible_to_sv with string_view_t param 2023-09-22 18:24:45 +03:00
gabime
b19ceb6d0a Remove refs from format_string param 2023-09-22 18:24:45 +03:00
gabime
cead430eed Fixed compile 2023-09-22 18:24:45 +03:00
gabime
90e92438c8 clang format 2023-09-22 18:24:45 +03:00
gabime
1faeb5b6fa Minor cleanups 2023-09-22 18:24:45 +03:00
gabime
b3ab35cf8e Fix issues with string view 2023-09-22 18:24:45 +03:00
gabime
b2372fd076 Enable std::source_location if SPDLOG_EMIT_SOURCE_LOCATION is defined 2023-09-22 18:24:45 +03:00
gabime
ac6b7ec87e check should_log in log_with_format_ 2023-09-22 18:24:45 +03:00
gabime
19d4e60561 Replaced details::make_unique with std::make_unique 2023-09-22 18:24:45 +03:00
gabime
4965d6ef68 Bumped bundled fmt to version 10.1.1 2023-09-22 18:24:45 +03:00
gabime
11770fc7e5 Added comment in ringbuffer_sink.h 2023-09-22 18:24:45 +03:00
gabime
8f7400731e ringbuffer_sink: replaced last_raw() and last_formatted() with drain_raw() and drain_formatted() and added tests 2023-09-22 18:24:45 +03:00
gabime
d8829e7714 Added [[nodiscard]] qualifiers to circular_q 2023-09-22 18:24:45 +03:00
gabime
55f84d458b Return true from details::circular_q::full() if capacity is 0 2023-09-22 18:24:45 +03:00
gabime
a8b74096b2 Simplified details::circular_q by removing iterator support and updated tests 2023-09-22 18:24:45 +03:00
gabime
aacea38f9d Updated details::circular_q and added some tests for it 2023-09-22 18:24:45 +03:00
gabime
202260719f merge 2023-09-22 18:24:45 +03:00
gabime
5993e78aac Removed SPDLOG_WCHAR_SUPPORT macro 2023-09-22 18:24:45 +03:00
gabime
7c054b6dba Inlined sink_it_ 2023-09-22 18:24:45 +03:00
gabime
54d402e094 Fixed tidy warning 2023-09-22 18:24:45 +03:00
gabime
6a53d6354b minor cleanup 2023-09-22 18:24:45 +03:00
gabime
a38add8456 Removed SPDLOG_NO_TLS and updated cmake 2023-09-22 18:24:45 +03:00
gabime
e1ee0c62a7 Replaced SPDLOG_CONSTEXPR and SPDLOG_NOEXCEPT macros with c++20 keywords 2023-09-22 18:24:45 +03:00
gabime
d7db2cf3aa Added some [[nodiscard]] annotations 2023-09-22 18:24:45 +03:00
gabime
6cac90b89a clang format 2023-09-22 18:24:45 +03:00
gabime
2ecc00e9c6 Simplified code 2023-09-22 18:24:45 +03:00
gabime
92daf6954b Removed backtrace feature 2023-09-22 18:24:45 +03:00
gabime
d94830814f Removed SPDLOG_WCHAR_TO_UTF8_SUPPORT 2023-09-22 18:24:45 +03:00
gabime
f530b2dbaa Upaded major ver to 2.0.0 2023-09-22 18:24:45 +03:00
gabime
213b2c0151 Bumped spdlog version to 1.12.0 2023-09-22 18:24:45 +03:00
gabime
27c518d509 Updated bundled fmt to version 10.0.0 2023-09-22 18:24:45 +03:00
gabime
ea6d8fde1d Upaded major ver to 2.0.0 2023-09-22 18:24:45 +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
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
gabime
bffceb90b0 Fixed circular_q size impl and added tests 2023-08-05 17:03:04 +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
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
4338b9cd23 Revert "Updated bundled fmt to version 10.0.0"
This reverts commit 62e55e7a7f.
2023-07-08 13:23:40 +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
gabime
169f827957 Added missing include to udp_client.h 2023-07-02 21:19:41 +03:00
gabime
62e55e7a7f Updated bundled fmt to version 10.0.0 2023-07-02 20:47:33 +03:00
gabime
b85c509ec6 Fixed clang warning in qt_sinks.h 2023-07-02 17:52:55 +03:00
gabime
b1eb4953fa Cleaned some warnings in qt_sinks 2023-07-02 17:52:55 +03:00
Simon-Janos
5ece88e5a8
Removing IPv4 limitation from tcp_client (#2790) 2023-06-30 20:08:22 +03:00
Jiang Y
326f8870c2
Update qt_sinks.h: narrow cast msg.color_range_start, msg.color_range_end (#2781) 2023-06-28 08:32:12 +03:00