question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Serial Monitor swallows my print lines

See original GitHub issue

Any Serial.print*() command does not seem to make it to output when it is preceded by a log_X() command, with X= e, i, d, w, v. This simple script:

#include <Arduino.h>
#include <esp_log.h>

void setup() {
    Serial.begin(115200);
    Serial.println("setup started ###########################################################");

    log_i("%s",  "some text");
    log_i("%s",  "more text");
    log_i("%s",  "even more text");

    Serial.println("1");
    Serial.println("2");
    Serial.println("3");
    Serial.println("4");
    Serial.println("5");

    log_e("%s",  "but where are my numbers?");
}

void loop() {}

produces this output:

18:35:24.821 > setup started ###########################################################
18:35:24.821 > [I][main.cpp:8] setup(): some text
18:35:24.821 > [I][main.cpp:9] setup(): more text
18:35:24.821 > [I][main.cpp:10] setup(): even more text
18:35:24.821 > [E][main.cpp:18] setup(): but where are my numbers?

Yes, where are the numbers?

Platformio.ini:

[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
monitor_speed = 115200
upload_speed = 921600
upload_port = /dev/ttyUSB0
build_flags = -D CORE_DEBUG_LEVEL=5
monitor_filters =
	log2file
	time
	default

[platformio]
description = Serial Monitor swallows print lines

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
maxgerhardtcommented, Jul 6, 2021

Okay then it seems to be in issue in their core. You should try and file a issue there to get the Serial and log_i() etc. functions / streams playing more nicely with each other.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Serial Monitor swallows my print lines - Arduino IDE 2.0
On Arduino 2.0 Beta7 the Serial Monitor may swallow `print()` output when follow…ed by 'log_X()' output. To make this visible the Tools->Core ...
Read more >
'\t' sent to Serial Monitor are converted to single space #675
I am not able to reproduce the issue with Arduino IDE 2.0.0-beta.11, ... Serial Monitor swallowing leading and repeated spaces #535.
Read more >
How do I update the serial monitor without printing a new line ...
No. The serial monitor does not support terminal handling. Either use a serial communications program that does and use those ...
Read more >
Issue sending string via COM Port to Arduino - NI Community
I figured the easiest way would be to build a string with these values and send it to an Arduino over the COM...
Read more >
Teensyduino 1.48 Beta #1 - PJRC (Teensy) Forum
The Serial Monitor improvement still has debug printing to Arduino's console. You'll see messages there as you open and close the serial ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found