54 void HOT
write_header(uint8_t level,
const char *tag,
int line,
const char *thread_name) {
56 if (this->
pos + MAX_HEADER_SIZE > this->size)
59 char *p = this->current_();
62 this->write_ansi_color_(p, level);
71 *p++ =
static_cast<char>(
progmem_read_byte(
reinterpret_cast<const uint8_t *
>(&LOG_LEVEL_LETTER_CHARS[level])));
78 this->copy_string_(p, tag);
83 if (line > 999) [[unlikely]] {
84 write_digit(p, line, 1000);
86 write_digit(p, line, 100);
87 write_digit(p, line, 10);
91#if defined(USE_ESP32) || defined(USE_LIBRETINY) || defined(USE_ZEPHYR) || defined(USE_HOST)
93 if (thread_name !=
nullptr) {
94 this->write_ansi_color_(p, 1);
96 this->copy_string_(p, thread_name);
98 this->write_ansi_color_(p, level);
135 const uint16_t available = this->remaining_();
136 const uint16_t copy_len = (text_length < available) ? text_length : available;
138 memcpy(this->current_(), text, copy_len);
139 this->
pos += copy_len;