Skip to content

Commit

Permalink
Fix analyser warning for RecordTime struct.
Browse files Browse the repository at this point in the history
Signed-off-by: Pavel Artsishevsky <polter.rnd@gmail.com>
  • Loading branch information
polter-rnd committed Nov 3, 2024
1 parent 3e65b09 commit 638a624
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions include/log/record.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,14 +163,22 @@ RecordStringView(const Char*, std::size_t) -> RecordStringView<Char>;
*/
struct RecordTime {
#ifdef ENABLE_FMTLIB
/** @brief Alias for \a std::tm. */
/**
* @brief Alias for \a std::tm.
*
* Time format with `fmt::format()` is much faster for std::tm.
*/
using TimePoint = std::tm;
#else
/** @brief Alias for \a std::chrono::sys_seconds. */
/**
* @brief Alias for \a std::chrono::sys_seconds.
*
* Time format with `std::format()` supports only `std::chrono` types.
*/
using TimePoint = std::chrono::sys_seconds;
#endif
TimePoint local; ///< Local time (seconds precision).
std::size_t nsec = {}; ///< Event time (nsec part).
TimePoint local = {}; ///< Local time (seconds precision).
std::size_t nsec = {}; ///< Event time (nanoseconds part).
};

/**
Expand Down

0 comments on commit 638a624

Please sign in to comment.