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>
* Expose the flusher thread object to user in order to allow setting of thread name and thread affinity when needed
* Code review fix - periodic_worker thread getter should return a reference and not a pointer
* 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
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.
This method applies levels which is set by environment variable
`SPDLOG_LEVEL` to the a single controller. Usefull for loading
configuration into manually created loggers.
Newlib C library (https://sourceware.org/newlib/) has a configuration
option to add tm_gmtoff field to the tm structure. Not all the
platforms supported by newlib enable this option, and spdlog doesn't
compile on such platforms due to missing tm_gmtoff field.
Fix this by checking for `__NEWLIB__` and `__TM_GMTOFF` and enabling
calculate_gmt_offset.
On musl, off_t is 64bit always ( even on 32bit platforms ), therefore
using LFS64 funcitons is not needed on such platforms. Moreover, musl
has stopped providing aliases for these functions [1] which means it
wont compile on newer musl systems. Therefore only use it on 32bit
glibc/linux platforms and exclude musl like cygwin or OSX
[1] https://git.musl-libc.org/cgit/musl/commit/?id=246f1c811448f37a44b41cd8df8d0ef9736d95f4
Signed-off-by: Khem Raj <raj.khem@gmail.com>