Skip to content

UCLA-Rocket-Project/RP_Logger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

Rocket Project Logger

Log with different levels and subsystems

Usage instructions

Setup

  1. Define, as RP_LOGGER_COMPILE_LEVEL, the minmum log level that you want to build for. This could also be a build flag
#define RP_LOGGER_COMPILE_LEVEL RP_LOGGER_TRACE
  1. Instantiate the logger, giving the maximum log level that you want to view and the subsystems that you want to see logs for
rp_logger_init(RP_LOGGER_TRACE, RpLoggerSubsys::ALL);
  1. Log away, like in the following examples
RP_LOG_TRACE(RADIO_CMD_TRANSPORT, "Got a command %x", command_code);

RP_LOG_INFO(ADC, "Read %u", adc_reading);

RP_LOG_WARN(CAN_BUS, "Could not send message");

RP_LOG_MUST(RESET_HANDLER, "Resetting all the boards");

Details

This uses esp-idf's puts function which is thread safe, so your logs appear nice and orderly

About

Cool ESP-IDF logging capabilities

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors