51 void HOT
write_header(uint8_t level,
const char *tag,
int line,
const char *thread_name) {
53 if (this->
pos + MAX_HEADER_SIZE > this->size)
56 char *p = this->current_();
59 this->write_ansi_color_(p, level);
68 *p++ =
static_cast<char>(
progmem_read_byte(
reinterpret_cast<const uint8_t *
>(&LOG_LEVEL_LETTER_CHARS[level])));
75 this->copy_string_(p, tag);
80 if (line > 999) [[unlikely]] {
81 write_digit(p, line, 1000);
83 write_digit(p, line, 100);
84 write_digit(p, line, 10);
88#if defined(USE_ESP32) || defined(USE_LIBRETINY) || defined(USE_ZEPHYR) || defined(USE_HOST)
90 if (thread_name !=
nullptr) {
91 this->write_ansi_color_(p, 1);
93 this->copy_string_(p, thread_name);
95 this->write_ansi_color_(p, level);
115 const uint16_t available = this->remaining_();
116 const uint16_t copy_len = (text_length < available) ? text_length : available;
118 memcpy(this->current_(), text, copy_len);
119 this->
pos += copy_len;