Skip to content

Preventing undefined thread ids in child processes

ethanvc edited this page Sep 19, 2020 · 5 revisions

By default spdlog saves thread ids in thread local storage to gain a few micros for each call, but if your program forks, you must uncomment the SPDLOG_DISABLE_TID_CACHING flag in tweakme.h.

This will prevent undefined thread ids in child log messages:

#define SPDLOG_DISABLE_TID_CACHING