Furi Logging system.
More...
#include <stdio.h>
#include <stdint.h>
#include <stdarg.h>
#include <stdbool.h>
Go to the source code of this file.
|
#define | _FURI_LOG_CLR(clr) |
|
#define | _FURI_LOG_CLR_RESET "\033[0m" |
|
#define | _FURI_LOG_CLR_BLACK "30" |
|
#define | _FURI_LOG_CLR_RED "31" |
|
#define | _FURI_LOG_CLR_GREEN "32" |
|
#define | _FURI_LOG_CLR_BROWN "33" |
|
#define | _FURI_LOG_CLR_BLUE "34" |
|
#define | _FURI_LOG_CLR_PURPLE "35" |
|
#define | _FURI_LOG_CLR_E _FURI_LOG_CLR(_FURI_LOG_CLR_RED) |
|
#define | _FURI_LOG_CLR_W _FURI_LOG_CLR(_FURI_LOG_CLR_BROWN) |
|
#define | _FURI_LOG_CLR_I _FURI_LOG_CLR(_FURI_LOG_CLR_GREEN) |
|
#define | _FURI_LOG_CLR_D _FURI_LOG_CLR(_FURI_LOG_CLR_BLUE) |
|
#define | _FURI_LOG_CLR_T _FURI_LOG_CLR(_FURI_LOG_CLR_PURPLE) |
|
#define | FURI_LOG_E(tag, format, ...) |
| Log methods.
|
|
#define | FURI_LOG_W(tag, format, ...) |
|
#define | FURI_LOG_I(tag, format, ...) |
|
#define | FURI_LOG_D(tag, format, ...) |
|
#define | FURI_LOG_T(tag, format, ...) |
|
#define | FURI_LOG_RAW_E(format, ...) |
| Log methods.
|
|
#define | FURI_LOG_RAW_W(format, ...) |
|
#define | FURI_LOG_RAW_I(format, ...) |
|
#define | FURI_LOG_RAW_D(format, ...) |
|
#define | FURI_LOG_RAW_T(format, ...) |
|
|
typedef void(* | FuriLogHandlerCallback) (const uint8_t *data, size_t size, void *context) |
|
|
enum | FuriLogLevel {
FuriLogLevelDefault = 0
, FuriLogLevelNone = 1
, FuriLogLevelError = 2
, FuriLogLevelWarn = 3
,
FuriLogLevelInfo = 4
, FuriLogLevelDebug = 5
, FuriLogLevelTrace = 6
} |
|
◆ _FURI_LOG_CLR
#define _FURI_LOG_CLR |
( |
| clr | ) |
|
◆ FURI_LOG_D
#define FURI_LOG_D |
( |
| tag, |
|
|
| format, |
|
|
| ... ) |
Value:
void furi_log_print_format(FuriLogLevel level, const char *tag, const char *format,...) _ATTRIBUTE((__format__(__printf__
Print log record.
◆ FURI_LOG_E
#define FURI_LOG_E |
( |
| tag, |
|
|
| format, |
|
|
| ... ) |
Value:
Log methods.
- Parameters
-
tag | The application tag |
format | The format |
... | VA Args |
◆ FURI_LOG_I
#define FURI_LOG_I |
( |
| tag, |
|
|
| format, |
|
|
| ... ) |
◆ FURI_LOG_RAW_D
#define FURI_LOG_RAW_D |
( |
| format, |
|
|
| ... ) |
Value:
void void furi_log_print_raw_format(FuriLogLevel level, const char *format,...) _ATTRIBUTE((__format__(__printf__
Print log record.
◆ FURI_LOG_RAW_E
#define FURI_LOG_RAW_E |
( |
| format, |
|
|
| ... ) |
Value:
Log methods.
- Parameters
-
format | The raw format |
... | VA Args |
◆ FURI_LOG_RAW_I
#define FURI_LOG_RAW_I |
( |
| format, |
|
|
| ... ) |
◆ FURI_LOG_RAW_T
#define FURI_LOG_RAW_T |
( |
| format, |
|
|
| ... ) |
◆ FURI_LOG_RAW_W
#define FURI_LOG_RAW_W |
( |
| format, |
|
|
| ... ) |
◆ FURI_LOG_T
#define FURI_LOG_T |
( |
| tag, |
|
|
| format, |
|
|
| ... ) |
◆ FURI_LOG_W
#define FURI_LOG_W |
( |
| tag, |
|
|
| format, |
|
|
| ... ) |
◆ furi_log_add_handler()
Add log TX callback.
- Parameters
-
[in] | handler | The callback and its context |
- Returns
- true on success, false otherwise
◆ furi_log_get_level()
FuriLogLevel furi_log_get_level |
( |
void | | ) |
|
Get log level.
- Returns
- The furi log level.
◆ furi_log_level_from_string()
bool furi_log_level_from_string |
( |
const char * | str, |
|
|
FuriLogLevel * | level ) |
Log level from string.
- Parameters
-
[in] | str | The string |
[out] | level | The level |
- Returns
- True if success, False otherwise
◆ furi_log_level_to_string()
bool furi_log_level_to_string |
( |
FuriLogLevel | level, |
|
|
const char ** | str ) |
Log level to string.
- Parameters
-
[in] | level | The level |
[out] | str | String representation of the level |
- Returns
- True if success, False otherwise
◆ furi_log_print_format()
void furi_log_print_format |
( |
FuriLogLevel | level, |
|
|
const char * | tag, |
|
|
const char * | format, |
|
|
| ... ) |
Print log record.
- Parameters
-
◆ furi_log_print_raw_format()
void void furi_log_print_raw_format |
( |
FuriLogLevel | level, |
|
|
const char * | format, |
|
|
| ... ) |
Print log record.
- Parameters
-
◆ furi_log_puts()
void furi_log_puts |
( |
const char * | data | ) |
|
Transmit data through log IO callbacks.
- Parameters
-
[in] | data | The data, null-terminated C-string |
◆ furi_log_remove_handler()
Remove log TX callback.
- Parameters
-
[in] | handler | The callback and its context |
- Returns
- true on success, false otherwise
◆ furi_log_set_level()
void void void furi_log_set_level |
( |
FuriLogLevel | level | ) |
|
Set log level.
- Parameters
-
◆ furi_log_tx()
void furi_log_tx |
( |
const uint8_t * | data, |
|
|
size_t | size ) |
Transmit data through log IO callbacks.
- Parameters
-
[in] | data | The data |
[in] | size | The size |