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

#include <pattern_formatter.h>

Inheritance diagram for spdlog::details::source_location_formatter:
spdlog::details::flag_formatter

Public Member Functions

 source_location_formatter (padding_info padinfo)
 
void format (const details::log_msg &msg, const std::tm &, 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 828 of file pattern_formatter.h.

Constructor & Destructor Documentation

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

Definition at line 831 of file pattern_formatter.h.

832  : flag_formatter(padinfo){};

Member Function Documentation

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

Implements spdlog::details::flag_formatter.

Definition at line 834 of file pattern_formatter.h.

835  {
836  if (msg.source.empty())
837  {
838  return;
839  }
840  if (padinfo_.enabled())
841  {
842  const auto text_size = std::char_traits<char>::length(msg.source.filename) + fmt_helper::count_digits(msg.source.line) + 1;
843  scoped_pad p(text_size, padinfo_, dest);
844  fmt_helper::append_string_view(msg.source.filename, dest);
845  dest.push_back(':');
846  fmt_helper::append_int(msg.source.line, dest);
847  }
848  else
849  {
850  fmt_helper::append_string_view(msg.source.filename, dest);
851  dest.push_back(':');
852  fmt_helper::append_int(msg.source.line, dest);
853  }
854  }
void msg(const char *fmt,...)
Definition: message.cpp:107
void append_int(T n, fmt::basic_memory_buffer< char, Buffer_Size > &dest)
Definition: fmt_helper.h:40
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
unsigned count_digits(T n)
Definition: fmt_helper.h:47

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