Contents

SushiEngine::Logging

format_log_line

std::size_t format_log_line(const LogRecord &record, char *destination, std::size_t capacity) noexcept

Parameters

NameType
recordconst LogRecord &
destinationchar *
capacitystd::size_t

Returns

std::size_t

The characters written; a line that does not fit is cut and ends in "...\n".

Description

Writes "[HH:MM:SS.mmm] [LEVEL] [category] [thread N] message (file:line)\n" into destination, wrapping the day and holding for a negative wall_clock_nanoseconds; a '
' or '\r' inside a field becomes one space.

Precondition

capacity is at least 8.