spdlog icon indicating copy to clipboard operation
spdlog copied to clipboard

spdlog::shutdown()

Open jphz opened this issue 1 year ago • 2 comments

Will the remaining logs in the buffer be written?

jphz avatar May 26 '24 02:05 jphz

Short answer: the sink is destroyed and the buffer is written.

Long answer: the sink registered in the spdlog registry is destroyed and is written from the buffer in the destructor of the sink. However, there is no guarantee that the data in the buffer will be written since the destructor of sink is not called if a reference to sink remains in another location.

tt4g avatar May 26 '24 03:05 tt4g

I think I understand now, thank you.

jphz avatar May 26 '24 08:05 jphz