Public Member Functions | List of all members
spdlog::details::c_formatter Class Referencefinal

#include <pattern_formatter.h>

Inheritance diagram for spdlog::details::c_formatter:
spdlog::details::flag_formatter

Public Member Functions

 c_formatter (padding_info padinfo)
 
void format (const details::log_msg &, const std::tm &tm_time, fmt::memory_buffer &dest) override
 
- Public Member Functions inherited from spdlog::details::flag_formatter
 flag_formatter (padding_info padinfo)
 
 flag_formatter ()=default
 
virtual ~flag_formatter ()=default
 

Additional Inherited Members

- Protected Attributes inherited from spdlog::details::flag_formatter
padding_info padinfo_
 

Detailed Description

Definition at line 280 of file pattern_formatter.h.

Constructor & Destructor Documentation

spdlog::details::c_formatter::c_formatter ( padding_info  padinfo)
inlineexplicit

Definition at line 283 of file pattern_formatter.h.

284  : flag_formatter(padinfo)
285  {
286  }

Member Function Documentation

void spdlog::details::c_formatter::format ( const details::log_msg ,
const std::tm &  tm_time,
fmt::memory_buffer dest 
)
inlineoverridevirtual

Implements spdlog::details::flag_formatter.

Definition at line 288 of file pattern_formatter.h.

289  {
290  const size_t field_size = 24;
291  scoped_pad p(field_size, padinfo_, dest);
292 
293  fmt_helper::append_string_view(days[tm_time.tm_wday], dest);
294  dest.push_back(' ');
295  fmt_helper::append_string_view(months[tm_time.tm_mon], dest);
296  dest.push_back(' ');
297  fmt_helper::append_int(tm_time.tm_mday, dest);
298  dest.push_back(' ');
299  // time
300 
301  fmt_helper::pad2(tm_time.tm_hour, dest);
302  dest.push_back(':');
303  fmt_helper::pad2(tm_time.tm_min, dest);
304  dest.push_back(':');
305  fmt_helper::pad2(tm_time.tm_sec, dest);
306  dest.push_back(' ');
307  fmt_helper::append_int(tm_time.tm_year + 1900, dest);
308  }
void append_int(T n, fmt::basic_memory_buffer< char, Buffer_Size > &dest)
Definition: fmt_helper.h:40
static const char * months[]
static const char * days[]
void append_string_view(spdlog::string_view_t view, fmt::basic_memory_buffer< char, Buffer_Size > &dest)
Definition: fmt_helper.h:30
p
Definition: test.py:223
void pad2(int n, fmt::basic_memory_buffer< char, Buffer_Size > &dest)
Definition: fmt_helper.h:54

The documentation for this class was generated from the following file: