Agora
1.2.0
Agora project
|
Go to the documentation of this file.
6 #ifndef SPDLOG_HEADER_ONLY
106 template<
typename ScopedPadder>
122 template<
typename ScopedPadder>
139 template<
typename ScopedPadder>
150 ScopedPadder
p(level_name.size(),
padinfo_, dest);
159 static const char *
ampm(
const tm &t)
161 return t.tm_hour >= 12 ?
"PM" :
"AM";
166 return t.tm_hour > 12 ? t.tm_hour - 12 : t.tm_hour;
170 static std::array<const char *, 7>
days{{
"Sun",
"Mon",
"Tue",
"Wed",
"Thu",
"Fri",
"Sat"}};
172 template<
typename ScopedPadder>
183 ScopedPadder
p(field_value.size(),
padinfo_, dest);
189 static std::array<const char *, 7>
full_days{{
"Sunday",
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday"}};
191 template<
typename ScopedPadder>
202 ScopedPadder
p(field_value.size(),
padinfo_, dest);
208 static const std::array<const char *, 12>
months{{
"Jan",
"Feb",
"Mar",
"Apr",
"May",
"Jun",
"Jul",
"Aug",
"Sept",
"Oct",
"Nov",
"Dec"}};
210 template<
typename ScopedPadder>
221 ScopedPadder
p(field_value.size(),
padinfo_, dest);
228 {
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December"}};
230 template<
typename ScopedPadder>
241 ScopedPadder
p(field_value.size(),
padinfo_, dest);
247 template<
typename ScopedPadder>
257 const size_t field_size = 24;
258 ScopedPadder
p(field_size,
padinfo_, dest);
279 template<
typename ScopedPadder>
289 const size_t field_size = 2;
290 ScopedPadder
p(field_size,
padinfo_, dest);
296 template<
typename ScopedPadder>
306 const size_t field_size = 10;
307 ScopedPadder
p(field_size,
padinfo_, dest);
318 template<
typename ScopedPadder>
328 const size_t field_size = 4;
329 ScopedPadder
p(field_size,
padinfo_, dest);
335 template<
typename ScopedPadder>
345 const size_t field_size = 2;
346 ScopedPadder
p(field_size,
padinfo_, dest);
352 template<
typename ScopedPadder>
362 const size_t field_size = 2;
363 ScopedPadder
p(field_size,
padinfo_, dest);
369 template<
typename ScopedPadder>
379 const size_t field_size = 2;
380 ScopedPadder
p(field_size,
padinfo_, dest);
386 template<
typename ScopedPadder>
396 const size_t field_size = 2;
397 ScopedPadder
p(field_size,
padinfo_, dest);
403 template<
typename ScopedPadder>
413 const size_t field_size = 2;
414 ScopedPadder
p(field_size,
padinfo_, dest);
420 template<
typename ScopedPadder>
430 const size_t field_size = 2;
431 ScopedPadder
p(field_size,
padinfo_, dest);
437 template<
typename ScopedPadder>
447 auto millis = fmt_helper::time_fraction<std::chrono::milliseconds>(msg.
time);
448 const size_t field_size = 3;
449 ScopedPadder
p(field_size,
padinfo_, dest);
455 template<
typename ScopedPadder>
465 auto micros = fmt_helper::time_fraction<std::chrono::microseconds>(msg.
time);
467 const size_t field_size = 6;
468 ScopedPadder
p(field_size,
padinfo_, dest);
474 template<
typename ScopedPadder>
484 auto ns = fmt_helper::time_fraction<std::chrono::nanoseconds>(msg.
time);
485 const size_t field_size = 9;
486 ScopedPadder
p(field_size,
padinfo_, dest);
492 template<
typename ScopedPadder>
502 const size_t field_size = 10;
503 ScopedPadder
p(field_size,
padinfo_, dest);
504 auto duration = msg.
time.time_since_epoch();
505 auto seconds = std::chrono::duration_cast<std::chrono::seconds>(duration).count();
511 template<
typename ScopedPadder>
521 const size_t field_size = 2;
522 ScopedPadder
p(field_size,
padinfo_, dest);
528 template<
typename ScopedPadder>
538 const size_t field_size = 11;
539 ScopedPadder
p(field_size,
padinfo_, dest);
552 template<
typename ScopedPadder>
562 const size_t field_size = 5;
563 ScopedPadder
p(field_size,
padinfo_, dest);
572 template<
typename ScopedPadder>
582 const size_t field_size = 8;
583 ScopedPadder
p(field_size,
padinfo_, dest);
594 template<
typename ScopedPadder>
608 const size_t field_size = 6;
609 ScopedPadder
p(field_size,
padinfo_, dest);
615 total_minutes = -total_minutes;
645 template<
typename ScopedPadder>
656 ScopedPadder
p(field_size,
padinfo_, dest);
662 template<
typename ScopedPadder>
674 ScopedPadder
p(field_size,
padinfo_, dest);
679 template<
typename ScopedPadder>
757 template<
typename ScopedPadder>
784 ScopedPadder
p(text_size,
padinfo_, dest);
792 template<
typename ScopedPadder>
808 ScopedPadder
p(text_size,
padinfo_, dest);
813 template<
typename ScopedPadder>
822 # pragma warning(push)
823 # pragma warning(disable : 4127) // consider using 'if constexpr' instead
832 return rv !=
nullptr ? rv + 1 :
filename;
837 const std::reverse_iterator<const char *>
end(
filename);
844 # pragma warning(pop)
856 ScopedPadder
p(text_size,
padinfo_, dest);
861 template<
typename ScopedPadder>
878 ScopedPadder
p(field_size,
padinfo_, dest);
884 template<
typename ScopedPadder>
900 ScopedPadder
p(text_size,
padinfo_, dest);
906 template<
typename ScopedPadder,
typename Units>
920 auto delta_units = std::chrono::duration_cast<DurationUnits>(delta);
922 auto delta_count =
static_cast<size_t>(delta_units.count());
924 ScopedPadder
p(n_digits,
padinfo_, dest);
943 using std::chrono::duration_cast;
944 using std::chrono::milliseconds;
945 using std::chrono::seconds;
948 auto duration = msg.
time.time_since_epoch();
949 auto secs = duration_cast<seconds>(duration);
977 auto millis = fmt_helper::time_fraction<milliseconds>(msg.
time);
1024 : pattern_(
std::move(pattern))
1025 , eol_(
std::move(eol))
1026 , pattern_time_type_(time_type)
1027 , need_localtime_(false)
1029 , custom_handlers_(
std::move(custom_user_flags))
1038 , eol_(
std::move(eol))
1039 , pattern_time_type_(time_type)
1040 , need_localtime_(true)
1052 cloned_custom_formatters[it.first] = it.second->clone();
1061 const auto secs = std::chrono::duration_cast<std::chrono::seconds>(msg.
time.time_since_epoch());
1093 template<
typename Padder>
1100 auto custom_handler = it->second->clone();
1101 custom_handler->set_padding_info(padding);
1110 formatters_.push_back(details::make_unique<details::full_formatter>(padding));
1253 formatters_.push_back(details::make_unique<details::color_start_formatter>(padding));
1257 formatters_.push_back(details::make_unique<details::color_stop_formatter>(padding));
1281 formatters_.push_back(details::make_unique<details::ch_formatter>(
'%'));
1301 auto unknown_flag = details::make_unique<details::aggregate_formatter>();
1305 unknown_flag->add_ch(
'%');
1306 unknown_flag->add_ch(flag);
1316 unknown_flag->add_ch(flag);
1331 const size_t max_width = 64;
1334 return padding_info{};
1337 padding_info::pad_side side;
1353 if (it ==
end || !std::isdigit(
static_cast<unsigned char>(*it)))
1355 return padding_info{};
1358 auto width =
static_cast<size_t>(*it) -
'0';
1359 for (++it; it !=
end && std::isdigit(
static_cast<unsigned char>(*it)); ++it)
1361 auto digit =
static_cast<size_t>(*it) -
'0';
1362 width = width * 10 + digit;
1367 if (it !=
end && *it ==
'!')
1381 auto end = pattern.end();
1382 std::unique_ptr<details::aggregate_formatter> user_chars;
1384 for (
auto it = pattern.begin(); it !=
end; ++it)
1397 if (padding.enabled())
1399 handle_flag_<details::scoped_padder>(*it, padding);
1403 handle_flag_<details::null_scoped_padder>(*it, padding);
1415 user_chars = details::make_unique<details::aggregate_formatter>();
1417 user_chars->add_ch(*it);
const SPDLOG_INLINE string_view_t & to_string_view(spdlog::level::level_enum l) SPDLOG_NOEXCEPT
Definition: common-inl.h:23
static int to12h(const tm &t)
Definition: pattern_formatter-inl.h:164
Definition: pattern_formatter.h:23
const char * funcname
Definition: common.h:305
const char * filename
Definition: common.h:303
void push_back(const T &value)
Definition: core.h:849
const padding_info & padinfo_
Definition: pattern_formatter-inl.h:89
string_view_t payload
Definition: log_msg.h:30
fmt::basic_string_view< char > string_view_t
Definition: common.h:154
static const SPDLOG_CONSTEXPR char folder_seps[]
Definition: os.h:43
static std::array< const char *, 7 > days
Definition: pattern_formatter-inl.h:170
constexpr auto size() const -> size_t
Definition: core.h:820
for p
Definition: process_rx_frame.m:36
void pad_it(long count)
Definition: pattern_formatter-inl.h:84
void clear()
Definition: core.h:832
@ right
Definition: core.h:2021
end IFFT Reshape the symbol vector into two different spatial streams length(tx_syms)/NUM_UE
constexpr auto size() const -> size_t
Definition: core.h:495
bool truncate_
Definition: pattern_formatter.h:46
SPDLOG_INLINE spdlog::log_clock::time_point now() SPDLOG_NOEXCEPT
Definition: os-inl.h:71
size_t color_range_end
Definition: log_msg.h:27
count
Definition: inspect_agora_results.m:96
~scoped_padder()
Definition: pattern_formatter-inl.h:70
memory_buf_t & dest_
Definition: pattern_formatter-inl.h:90
auto is_negative(T value) -> bool
Definition: format.h:888
SPDLOG_INLINE int utc_minutes_offset(const std::tm &tm)
Definition: os-inl.h:263
std::chrono::system_clock log_clock
Definition: common.h:126
filename
Definition: parse_all_dl.m:14
long remaining_pad_
Definition: pattern_formatter-inl.h:91
static unsigned int count_digits(T n)
Definition: pattern_formatter-inl.h:65
pad_side side_
Definition: pattern_formatter.h:45
void resize(size_t count)
Definition: format.h:763
SPDLOG_INLINE std::tm gmtime(const std::time_t &time_tt) SPDLOG_NOEXCEPT
Definition: os-inl.h:103
const SPDLOG_INLINE char * to_short_c_str(spdlog::level::level_enum l) SPDLOG_NOEXCEPT
Definition: common-inl.h:28
static const std::array< const char *, 12 > months
Definition: pattern_formatter-inl.h:208
@ center
Definition: core.h:2021
auto begin() -> T *
Definition: core.h:813
null_scoped_padder(size_t, const padding_info &, memory_buf_t &)
Definition: pattern_formatter-inl.h:97
string_view_t logger_name
Definition: log_msg.h:20
string_view_t spaces_
Definition: pattern_formatter-inl.h:92
SPDLOG_INLINE std::tm localtime(const std::time_t &time_tt) SPDLOG_NOEXCEPT
Definition: os-inl.h:84
#define SPDLOG_INLINE
Definition: common.h:42
size_t thread_id
Definition: log_msg.h:23
std::unique_ptr< T > make_unique(Args &&... args)
Definition: common.h:334
void pad3(T n, memory_buf_t &dest)
Definition: fmt_helper.h:126
int line
Definition: common.h:304
auto end() -> T *
Definition: core.h:814
level::level_enum level
Definition: log_msg.h:21
void append(const ContiguousRange &range)
Definition: format.h:771
SPDLOG_INLINE int pid() SPDLOG_NOEXCEPT
Definition: os-inl.h:404
Definition: pattern_formatter-inl.h:95
static unsigned int count_digits(T)
Definition: pattern_formatter-inl.h:100
constexpr auto data() const -> const Char *
Definition: core.h:492
unsigned int count_digits(T n)
Definition: fmt_helper.h:83
void append_string_view(spdlog::string_view_t view, memory_buf_t &dest)
Definition: fmt_helper.h:26
pattern_time_type
Definition: common.h:267
static std::array< const char *, 7 > full_days
Definition: pattern_formatter-inl.h:189
Definition: json.hpp:5213
bool enabled() const
Definition: pattern_formatter.h:40
static const std::array< const char *, 12 > full_months
Definition: pattern_formatter-inl.h:227
Definition: pattern_formatter-inl.h:37
source_loc source
Definition: log_msg.h:29
size_t color_range_start
Definition: log_msg.h:26
scoped_padder(size_t wrapped_size, const padding_info &padinfo, memory_buf_t &dest)
Definition: pattern_formatter-inl.h:40
static const char * ampm(const tm &t)
Definition: pattern_formatter-inl.h:159
size_t width_
Definition: pattern_formatter.h:44
void pad6(T n, memory_buf_t &dest)
Definition: fmt_helper.h:143
void append_int(T n, memory_buf_t &dest)
Definition: fmt_helper.h:52
void pad2(int n, memory_buf_t &dest)
Definition: fmt_helper.h:101
log_clock::time_point time
Definition: log_msg.h:22
constexpr bool empty() const noexcept
Definition: common.h:299
void pad9(T n, memory_buf_t &dest)
Definition: fmt_helper.h:149