Skip to content

Commit

Permalink
Update Logger.h
Browse files Browse the repository at this point in the history
  • Loading branch information
odygrd authored Aug 15, 2024
1 parent e9ce4ca commit 478d894
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions include/quill/Logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<uint64_t>(std::chrono::duration_cast<std::chrono::nanoseconds>(
Expand All @@ -99,7 +100,7 @@ class LoggerImpl : public detail::LoggerBase
detail::ThreadContext* const thread_context =
quill::detail::get_local_thread_context<frontend_options_t>();

// 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...);
Expand Down Expand Up @@ -337,4 +338,4 @@ class LoggerImpl : public detail::LoggerBase

using Logger = LoggerImpl<FrontendOptions>;

QUILL_END_NAMESPACE
QUILL_END_NAMESPACE

0 comments on commit 478d894

Please sign in to comment.