Commit Graph

2378 Commits (eae7a751fe27c8a28438adb138ffea6694daf4f3)

Author SHA1 Message Date
Lixingcong eae7a751fe
Merge 8841b7e2d5 into f1d748e5e3 2 weeks ago
Angelio Mason f1d748e5e3
Remove the fileapi.h include in os-inl.h (#3444)
* Replaced fileapi.h include with windows.h, as instructed in https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-flushfilebuffers
Otherwise this causes compilation error on older sdks.

* Removed the fileapi.h include entirely, since windows.h is already included before

---------

Co-authored-by: MasonAngelio <MasonAngelio>
3 weeks ago
Mihir Patel 9ecdf5c8a1
Added timeout for TCP calls such as connect, send, recv (#3432)
* Now lets test on windows

* I guess testing on windows passes.

* Update tcp_client-windows.h

Added default value to argument

* Final edit

* Update tcp_client-windows.h

Changed improper misplaced includes.
1 month ago
Gabi Melman a6215527f4
Fix ringbuffer tests for newline (#3436) 2 months ago
VZ 287333ee00
Remove unnecessary and inconsistent "final" from color sinks (#3430)
The use of "final" differed between ansicolor_sink and wincolor_sink,
resulting in the code inheriting from std{err,out}_color_sink classes,
which are defined as one or the other on different platforms, being able
to override most of the functions under non-Windows platforms, but not
under Windows.

This seems gratuitously inconsistent, so just remove all "final"
keywords from both classes, especially because there doesn't seem any
good reason to use it and the other sink classes don't use it (with the
exception of base_sink, which is special).

This also incidentally fixes using "final override" in most places but
"override final" in wincolor_sink.h.

Fixes #3429.
2 months ago
电线杆 ad725d34cc
Use std::getenv #3414 (#3415) 3 months ago
Gabi Melman e655dbb685
Fix issue #3408
Remove including core.h or base.h
3 months ago
Gabi Melman 37ff466454
Add coverity scan to CI and fix warnings (#3400)
* Move callback function in thread_pool ctor

* Added const qualifiers to logger.h

* Remove unused includes from file_helper-inl.h

* Fix comments and remove unused include from helpers-inl.h

* Fix typo in comment for set_default_logger method.

* Use `std::move` for `old_logger` in `set_default_logger`.

* Use std::move in example

* Wrap `main` content in try block for exception safety.

* Added coverity to ci
4 months ago
Gabi Melman 6fa36017cf
Version 1.15.3 4 months ago
Gabi Melman 7ca6a4fb27
Update commemt 4 months ago
Gabi Melman 070e1c9747
Update comment 4 months ago
Gabi Melman 0d31acae28
Fmt 11.2.0 (#3399)
* Bump fmt to 11.2.0
4 months ago
Gabi Melman 943fcbd761
Register replace logger (#3398)
* Add register_or_replace(logger) to atomically replace logger in registry
* fix some  comments
4 months ago
Gabi Melman 7e022c4300
Feature 3379 (#3397)
* Fix #3379

* clang format
4 months ago
Tihran Katolikian 847db3375f
dup_filter_sink: remove notification_level argument; use last message log level for notification instead (#3390) 4 months ago
gabime 48bcf39a66 Version 1.15.2 5 months ago
Gabi Melman 9c58257480
Fix zformatter on Apple and POSIX.1-2024 conforming platform (#3366)
* Add test case for #3351 (wrong GMT offset in SunOS/Solaris fallback)

* Fix #3352 (Missing test for Apple / POSIX.1-2024 chooses buggy workaround)

Apple platforms have had the tm_gmtoff-field at least since Mac OS X 10.0,
as are POSIX.1-2024 conforming systems, which are also required to support
it.

This has the unfortunate effect to use the SunOS/Solaris fallback, which
doesn't compute the correct value if the passed value of tm isn't the
current system time, i.e. localtime(::time()) (#3351).

* Fixed GMT offset test

---------

Co-authored-by: toh <toh@ableton.com>
5 months ago
gabime faa0a7a9c5 Bump fmt to version 11.1.4 5 months ago
Gabi Melman 10320184df
Fixed issue #3360 (#3361) 5 months ago
Gabi Melman ac432c3602
Gabime/v1.15.1 (#3332)
* Updated bundled fmt to version 11.1.3

* Bump version to 1.15.1
7 months ago
Janusz Chorko 3c23c27d2d
Revert "fix: Compatibility with external fmtlib 11.1.1 (#3312)" (#3331)
This reverts commit 7f8060d5b2.
7 months ago
Ken Matsui ae1de0dc8c
Support custom environment variables for load_env_levels (#3327)
SPDLOG_LEVEL is currently supported to control log levels via
load_env_levels.

This patch adds support for other environment variable names, such as
MYAPP_LEVEL, for load_env_levels.
7 months ago
Gabi Melman 7cbf2a6967
Gabime/ansicolor sink improvements (#3323)
* Added lock to set_color_mode in asnicolor_sink

* Added const qualifiers to some ansicolor_sink functions
7 months ago
Alexander 57505989b7
SPDLOG_LEVEL_NAMES, comment use string_view_literals (#3291)
* SPDLOG_LEVEL_NAMES, comment use string_view_literals

* SPDLOG_LEVEL_NAMES, comment use string_view_literals
7 months ago
koniarik ad0f31c009
Enabled bin_to_hex utest for stdformat, fixed std::formatter (#3315)
* Enabled bin_to_hex utest for stdformat, and fixed std::formatter

* fixed usage of \ in macos.yml

* explicitly cast diff variable in test_sink

* moved from ::iterator to decltype

* added fix for custom callbacks

---------

Co-authored-by: Jan Koniarik <veverak@Jans-MacBook-Pro.local>
8 months ago
jdrouhard 96a8f6250c
fix: remove unused to_string_view overload in fmt >= 11.1 (#3314) 8 months ago
Christian Blichmann 7f8060d5b2
fix: Compatibility with external fmtlib 11.1.1 (#3312)
Include fmtlib's `xchar` header to include `fmt::basic_format_string`.
Otherwise, compilation with an external fmtlib 11.1.1 fails with

```
In file included from include/spdlog/spdlog.h:12:
include/spdlog/common.h:369:49: error: no template named 'basic_format_string' in namespace 'fmt'; did you mean 'std::basic_format_string'?
  369 | inline fmt::basic_string_view<T> to_string_view(fmt::basic_format_string<T, Args...> fmt) {
      |                                                 ^~~~~
```

Signed-off-by: Christian Blichmann <cblichmann@google.com>
8 months ago
Rui Chen 276ee5f5c0
fix: update to_string_view function for fmt 11.1 (#3301)
Signed-off-by: Rui Chen <rui@chenrui.dev>
8 months ago
Matteo Del Seppia 24dde318fe
Adding lock to rotate_now() (#3281) 9 months ago
Matteo Del Seppia 65e388e82b
Adding on demand truncation for basic file sinks (#3280)
* Adding support to truncate on demand for basic file sink

* Remove unnecessary file close

* Adding lock in basic_file_sink truncate()
9 months ago
Gabi Melman 1e6250e183
Gabime/fwrite unlocked (#3276)
* Use locking fwrite_unlocked if possible

* Added compile definitions to header_only
9 months ago
hjs-ast 951c5b9987
Allow manual rotation of rotating_file_sink (#3269)
* Allow manual rotation of rotating_file_sink

* Rename rotation method

* Attempted fix for tests on Windows

* Apply review mark-ups
9 months ago
Gabi Melman 15f539685b
Update null_sink to be final (#3267) 9 months ago
F1F88 51a0deca2c
docs: Removed duplicate line in daily_file_sink comment (#3249) 10 months ago
gabime 8e5613379f Version 1.15.0 10 months ago
captainurist 5673e9e545
utf8_to_wstrbuf now handles invalid utf8 sequences (#3244) 10 months ago
Gabi Melman 85bdab0c18
Update bundled fmt to 11.0.2 (#3236) 10 months ago
Gabi Melman 63d1884215
Gabime/async flush (#3235)
* Revert "Ensure flush callback gets called in move-assign operator (#3232)"

This reverts commit b6da59447f.

* Revert "Exchange promise for condition_variable when flushing (fixes #3221) (#3228)"

This reverts commit 16e0d2e77c.

* Revert PR #3049
10 months ago
Michael de Lang b6da59447f
Ensure flush callback gets called in move-assign operator (#3232) 10 months ago
Michael de Lang 16e0d2e77c
Exchange promise for condition_variable when flushing (fixes #3221) (#3228)
std::promise and std::future use std::call_once under the hood, which requires
the tls-model to be at least initial_exec, excluding local_exec.

Furthermore, gcc has a bug regarding exceptions in std::call_once that
is best avoided. See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66146
for more info.

Signed-off-by: Michael de Lang <kingoipo@gmail.com>
10 months ago
hydai e593f6695c
Fix warning - extra ';' for -Wextra-semi (#3198)
Signed-off-by: hydai <z54981220@gmail.com>
11 months ago
Gabi Melman 2c76e6101a
Fix #3194 - Use Sep instead of Sept for abbreviated month 11 months ago
Gabi Melman c1fbafdcef
Update mdc.h (#3185)
Update error message
12 months ago
allen_qfl 362214a349
fix/issue-3101: fix the issue where mdc ignores SPDLOG_NO_TLS (#3184)
Co-authored-by: dyf <yufeng.duan@senscape.com.cn>
12 months ago
Leslie 2169a6f6ae
use std::lock_guard instead of std::unique_lock (#3179) 12 months ago
Rasmus 271f0f3b14
Add info about max_files in the docstrings of hourly/daily file sinks (#3170) 12 months ago
Eugene Smirnov a3a0c9d663
compilation error gcc 8.5 with [-Werror=suggest-override] (#3158) 1 year ago
lixingcong 8841b7e2d5
Restore init thread-local var in mdc.h, not use reference-init 1 year ago
lixingcong d89fff6c7c
Initialize function-local static variables using "T& t = *new T" 1 year ago
Alex Overchenko 885b5473e2
Fix building with `FMT_ENFORCE_COMPILE_STRING` (#3137) 1 year ago