Log Management

2023-03-29
No Rating

The header file for log management related functions is dji_logger.h. This document describes the key information and usage of the structure and function prototypes in the dji_logger.h file.

Catalog

Definition, Enum and Struct

typedef function ConsoleFunc

Function: The console method that needs to be registered. product:all
typedef T_DjiReturnCode (*ConsoleFunc)(const uint8_t *data, uint16_t dataLen);

typedef enum E_DjiLoggerConsoleLogLevel

typedef enum {
    DJI_LOGGER_CONSOLE_LOG_LEVEL_ERROR = 0, /*!< Logger console error level. The method and level of the console are
                                                  associated with each other. If the level of the registered console
                                                  method is lower than this level, the level interface will not be
                                                  printed successfully. */
    DJI_LOGGER_CONSOLE_LOG_LEVEL_WARN = 1, /*!< Logger console warning level.The method and level of the console are
                                                    associated with each other. If the level of the registered console
                                                    method is lower than this level, the level interface will not be
                                                    printed successfully. */
    DJI_LOGGER_CONSOLE_LOG_LEVEL_INFO = 2, /*!< Logger console info level. The method and level of the console are
                                                 associated with each other. If the level of the registered console
                                                 method is lower than this level, the level interface will not be
                                                 printed successfully. */
    DJI_LOGGER_CONSOLE_LOG_LEVEL_DEBUG = 3, /*!< Logger console debug level. The method and level of the console are
                                                  associated with each other. If the level of the registered console
                                                  method is lower than this level, the level interface will not be
                                                  printed successfully. */
} E_DjiLoggerConsoleLogLevel;

typedef struct T_DjiLoggerConsole

typedef struct {
    uint8_t consoleLevel;           
    ConsoleFunc func;      
    bool isSupportColor;     
} T_DjiLoggerConsole;

Function

function DjiLogger_AddConsole

Function:Add the console function and level for Onboard SDK.product:all
T_DjiReturnCode DjiLogger_AddConsole(T_DjiLoggerConsole *console);
Parameter
console:pointer to the console function.
Return
The details for the return code please refer to: DjiErrorCode

function DjiLogger_UserLogOutput

Function:Print out the selected level log of the specified format by the registration method. product:all
void PsdkLogger_UserLogInfo(const char *fmt, ...);
Parameter
fmt:pointer to the format string that needs print out.
...: Variable parameters, consistent with the use of the system interface print out.
Return
The details for the return code please refer to: DjiErrorCode
If you have any comments or confusion about our documentation, you can click here to give feedback and we will get back to you as soon as possible.