diff --git a/include/quill/Logger.h b/include/quill/Logger.h index 33ade354..33e96845 100644 --- a/include/quill/Logger.h +++ b/include/quill/Logger.h @@ -89,6 +89,7 @@ class LoggerImpl : public detail::LoggerBase // Store the timestamp of the log statement at the start of the call. This gives more accurate // timestamp especially if the queue is full + // This is very rare but might lead to out of order timestamp in the log file if we block on push for too long uint64_t const current_timestamp = (clock_source == ClockSourceType::Tsc) ? detail::rdtsc() : (clock_source == ClockSourceType::System) ? static_cast(std::chrono::duration_cast( @@ -99,7 +100,7 @@ class LoggerImpl : public detail::LoggerBase detail::ThreadContext* const thread_context = quill::detail::get_local_thread_context(); - // Need to reserve additional space as we will be aligning the pointer + // Need to know how much size we need from the queue size_t total_size = sizeof(current_timestamp) + (sizeof(uintptr_t) * 3) + detail::compute_encoded_size_and_cache_string_lengths( thread_context->get_conditional_arg_size_cache(), fmt_args...); @@ -337,4 +338,4 @@ class LoggerImpl : public detail::LoggerBase using Logger = LoggerImpl; -QUILL_END_NAMESPACE \ No newline at end of file +QUILL_END_NAMESPACE