Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UART Log levels #66

Open
liquiddandruff opened this issue May 21, 2018 · 1 comment
Open

UART Log levels #66

liquiddandruff opened this issue May 21, 2018 · 1 comment
Assignees

Comments

@liquiddandruff
Copy link
Member

As discussed in slack:

there should be a way to set per-task log levels when printing to uart, and have it so by default when code is checked in, all (unimportant) debug output from all tasks are disabled. Instead, the output for these logs can be enabled via the cmd system during runtime.

@richarthurs
Copy link
Contributor

richarthurs commented May 22, 2018

Two print modes:

  • FLIGHT will always print the text out (important, non-debug messages)
  • DEBUG_ONLY is an additional level of verbosity, prints debug messages for us

Todo:

  • add a flag to sfu_uart.c for debug vs. flight print mode. It shall default to flight print mode.
  • add #defines to sfu_uart.h for DEBUG_ONLY and FLIGHT print modes. The flag variable will be set to either one of these (flight is default),
  • to the following functions, add a parameter for the caller to indicate whether the message will print in flight mode or debug mode
    -- serialSendQ
    -- serialSendQFromISR
    -- serialSendln
  • in each of those functions, add appropriate ifs to print the message depending on the debug mode setting. Messages with FLIGHT flag should print in flight mode and debug mode. Messages with DEBUG_ONLY should only print in debug mode.
  • Grep through the code and update all calls to those functions to include the FLIGHT flag. We will move anything that is better left as a debug_only level over later.
  • add a command to change the log mode. Here's how: https://www.youtube.com/watch?v=hxa5eqtNRWQ

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants