MengRao/fmtlog

Suggestion: application-defined queue size

tmartin-gh opened this issue · 1 comments

It would be useful for the application (perhaps in the preallocate() call) to be able to change the default ~1MB queue size, I.e. the BLK_CNT parameter.

In many circumstances, it is effective to reduce the polling interval instead. But there can be times of bursty logs in some applications where it isn’t feasible to reduce the polling interval and increasing buffer size works better.

Another alternative to prevent log dropping is using FMTLOG_BLOCK=1 to block the log-enqueuing thread, but again in times of very bursty logging it may be necessary to allow the log-enqueuing thread to run without blocking and use more buffer memory.

Just made log queue size configurable by adding macro FMTLOG_QUEUE_SIZE, please check the latest commit.