Logging in Applications

Hey Gurus,
I’m wondering if you could shed some light on the application logging examples for Flipper.
I was able to find following in Snake:
char buffer[12];
snprintf(buffer, sizeof(buffer), “Score: %u”, snake_state->len - 7);
It looks like standard logging, but I wasn’t able to find the place it’s printing to…

Use FURI_LOG_D(TAG, MSG) for logging. The D stands for debug and can be substituted for T (trace), I (info), E (error), W (warning). Tag is a short string like “SNAKE”, msg is the debug message itself

Example: FURI_LOG_I("SNAKE", "Score is %d", score)

2 Likes

Thanks for the answer. Another stupid one. How could I get the application log? I can’t see the statements printed in the main log available from qFlipper. What am I missing?

You need to connect to the serial CLI (if you’re on windows, use PuTTY) and run the log command

I’m on Mac. I tried to use Screen with /dev/cubmodemflip_Restih1 used by qFlipper with no success. Does it mean I need a separate FTDI-USB device?

Hm, screen should work fine. Can you also try running minicom -D /dev/cu,bmodemflip_Restih1 and see if it works?

Oh and btw, qFlipper has to be closed while you’re doing that

Worked like a charm. Thanks a tonn. For anyone coming after me here is a link for the how-to → CLI Command Line Interface Examples - #3 by bughuntr

1 Like