Lingxi
Lingxi

Reputation: 14977

Properly use asynchronous_sink::flush() in Boost.Log

According to the Boost.Log documentation (see the end of this page), the flush() method of asynchronous_sink requires

The sink frontend must be constructed without spawning a dedicated thread.

This requirement makes no sense to me. Furthermore, it is not met in example code throughout the Boost.Log documentation (e.g., see here and here). So, how to properly use the flush() method exactly?

Upvotes: 1

Views: 395

Answers (1)

Andrey Semashev
Andrey Semashev

Reputation: 10614

The precondition is incorrect. You can use flush when there is a dedicated record feeding thread.

Upvotes: 3

Related Questions