mirror of
https://github.com/esphome/esphome.git
synced 2025-10-08 04:43:46 +01:00
Merge branch 'no_mod_logger' into integration
This commit is contained in:
@@ -355,6 +355,12 @@ class Logger : public Component {
|
|||||||
buffer[pos++] = '[';
|
buffer[pos++] = '[';
|
||||||
copy_string(buffer, pos, tag);
|
copy_string(buffer, pos, tag);
|
||||||
buffer[pos++] = ':';
|
buffer[pos++] = ':';
|
||||||
|
// Format line number without modulo operations (passed by value, safe to mutate)
|
||||||
|
if (line > 999) [[unlikely]] {
|
||||||
|
int thousands = line / 1000;
|
||||||
|
buffer[pos++] = '0' + thousands;
|
||||||
|
line -= thousands * 1000;
|
||||||
|
}
|
||||||
int hundreds = line / 100;
|
int hundreds = line / 100;
|
||||||
int remainder = line - hundreds * 100;
|
int remainder = line - hundreds * 100;
|
||||||
int tens = remainder / 10;
|
int tens = remainder / 10;
|
||||||
|
Reference in New Issue
Block a user