|
|
|
@ -815,13 +815,11 @@ public:
|
|
|
|
|
explicit source_location_formatter(padding_info padinfo)
|
|
|
|
|
: flag_formatter(padinfo){};
|
|
|
|
|
|
|
|
|
|
void format(const details::log_msg &msg, const std::tm &, fmt::memory_buffer &dest) override
|
|
|
|
|
{
|
|
|
|
|
if(padinfo_.width_)
|
|
|
|
|
void format(const details::log_msg &msg, const std::tm &, fmt::memory_buffer &dest) override
|
|
|
|
|
{
|
|
|
|
|
if (padinfo_.width_)
|
|
|
|
|
{
|
|
|
|
|
const auto text_size = std::char_traits<char>::length(msg.source.filename)
|
|
|
|
|
+ fmt_helper::count_digits(msg.source.line)
|
|
|
|
|
+1;
|
|
|
|
|
const auto text_size = std::char_traits<char>::length(msg.source.filename) + fmt_helper::count_digits(msg.source.line) + 1;
|
|
|
|
|
scoped_pad p(text_size, padinfo_, dest);
|
|
|
|
|
fmt_helper::append_string_view(msg.source.filename, dest);
|
|
|
|
|
dest.push_back(':');
|
|
|
|
@ -833,7 +831,7 @@ void format(const details::log_msg &msg, const std::tm &, fmt::memory_buffer &de
|
|
|
|
|
dest.push_back(':');
|
|
|
|
|
fmt_helper::append_int(msg.source.line, dest);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
// print soruce filename
|
|
|
|
|
class source_filename_formatter final : public flag_formatter
|
|
|
|
@ -858,7 +856,8 @@ public:
|
|
|
|
|
void format(const details::log_msg &msg, const std::tm &, fmt::memory_buffer &dest) override
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
if(padinfo_.width_) {
|
|
|
|
|
if (padinfo_.width_)
|
|
|
|
|
{
|
|
|
|
|
const size_t field_size = fmt::internal::count_digits(msg.source.line);
|
|
|
|
|
scoped_pad p(field_size, padinfo_, dest);
|
|
|
|
|
fmt_helper::append_int(msg.source.line, dest);
|
|
|
|
|