Skip to content

File lt_logger.h

FileList > base > lt_logger.h

Go to the source code of this file.

  • #include <libretiny.h>

Public Functions

Type Name
void lt_log (const uint8_t level, const char * format, ...)
void lt_log_disable ()
Disable LT logger. Enable it back using lt_log_set_port(LT_UART_DEFAULT_LOGGER).
void void lt_log_set_port (uint8_t port)
Change log output port.

Macros

Type Name
define ESP_EARLY_LOGD (tag, ...) LT_D(__VA_ARGS__)
define ESP_EARLY_LOGE (tag, ...) LT_E(__VA_ARGS__)
define ESP_EARLY_LOGI (tag, ...) LT_I(__VA_ARGS__)
define ESP_EARLY_LOGV (tag, ...) LT_V(__VA_ARGS__)
define ESP_EARLY_LOGW (tag, ...) LT_W(__VA_ARGS__)
define ESP_LOGD (tag, ...) LT_D(__VA_ARGS__)
define ESP_LOGE (tag, ...) LT_E(__VA_ARGS__)
define ESP_LOGI (tag, ...) LT_I(__VA_ARGS__)
define ESP_LOGV (tag, ...) LT_V(__VA_ARGS__)
define ESP_LOGW (tag, ...) LT_W(__VA_ARGS__)
define ETS_PRINTF (...) LT_I(__VA_ARGS__)
define LT_D (...) LT_LOG(LT_LEVEL_DEBUG, __FUNCTION__, __LINE__, __VA_ARGS__)
define LT_DM (module, ...) LT_LOGM(LT_LEVEL_DEBUG, module, __FUNCTION__, __LINE__, __VA_ARGS__)
define LT_E (...) LT_LOG(LT_LEVEL_ERROR, __FUNCTION__, __LINE__, __VA_ARGS__)
define LT_EM (module, ...) LT_LOGM(LT_LEVEL_ERROR, module, __FUNCTION__, __LINE__, __VA_ARGS__)
define LT_ERRNO ()
define LT_ERRNO_LEZ (ret)
define LT_ERRNO_LZ (ret)
define LT_ERRNO_NZ (ret)
define LT_F (...) LT_LOG(LT_LEVEL_FATAL, __FUNCTION__, __LINE__, __VA_ARGS__)
define LT_FM (module, ...) LT_LOGM(LT_LEVEL_FATAL, module, __FUNCTION__, __LINE__, __VA_ARGS__)
define LT_HEAP_I ()
define LT_I (...) LT_LOG(LT_LEVEL_INFO, __FUNCTION__, __LINE__, __VA_ARGS__)
define LT_IM (module, ...) LT_LOGM(LT_LEVEL_INFO, module, __FUNCTION__, __LINE__, __VA_ARGS__)
define LT_LOG (level, caller, line, ...) lt_log(level, __VA_ARGS__)
define LT_LOGM (level, module, caller, line, ...)
define LT_RET (ret)
define LT_RET_LEZ (ret)
define LT_RET_LZ (ret)
define LT_RET_NZ (ret)
define LT_T (...) LT_LOG(LT_LEVEL_TRACE, __FUNCTION__, __LINE__, __VA_ARGS__)
define LT_TM (module, ...) LT_LOGM(LT_LEVEL_TRACE, module, __FUNCTION__, __LINE__, __VA_ARGS__)
define LT_V (...) LT_LOG(LT_LEVEL_TRACE, __FUNCTION__, __LINE__, __VA_ARGS__)
define LT_VM (module, ...) LT_LOGM(LT_LEVEL_TRACE, module, __FUNCTION__, __LINE__, __VA_ARGS__)
define LT_W (...) LT_LOG(LT_LEVEL_WARN, __FUNCTION__, __LINE__, __VA_ARGS__)
define LT_WM (module, ...) LT_LOGM(LT_LEVEL_WARN, module, __FUNCTION__, __LINE__, __VA_ARGS__)
define ets_printf (...) LT_I(__VA_ARGS__)
define isr_log_d (...) LT_D(__VA_ARGS__)
define isr_log_e (...) LT_E(__VA_ARGS__)
define isr_log_i (...) LT_I(__VA_ARGS__)
define isr_log_n (...) LT_E(__VA_ARGS__)
define isr_log_v (...) LT_V(__VA_ARGS__)
define isr_log_w (...) LT_W(__VA_ARGS__)
define log_d (...) LT_D(__VA_ARGS__)
define log_e (...) LT_E(__VA_ARGS__)
define log_i (...) LT_I(__VA_ARGS__)
define log_n (...) LT_E(__VA_ARGS__)
define log_printf (...) LT_I(__VA_ARGS__)
define log_v (...) LT_V(__VA_ARGS__)
define log_w (...) LT_W(__VA_ARGS__)

Public Functions Documentation

function lt_log

void lt_log (
    const uint8_t level,
    const char * format,
    ...
) 

function lt_log_disable

void lt_log_disable () 

function lt_log_set_port

Change log output port.

void void lt_log_set_port (
    uint8_t port
) 

Parameters:

  • port UART port index - can be 0, 1 or 2

Macro Definition Documentation

define ESP_EARLY_LOGD

#define ESP_EARLY_LOGD (
    tag,
    ...
) LT_D(__VA_ARGS__)

define ESP_EARLY_LOGE

#define ESP_EARLY_LOGE (
    tag,
    ...
) LT_E(__VA_ARGS__)

define ESP_EARLY_LOGI

#define ESP_EARLY_LOGI (
    tag,
    ...
) LT_I(__VA_ARGS__)

define ESP_EARLY_LOGV

#define ESP_EARLY_LOGV (
    tag,
    ...
) LT_V(__VA_ARGS__)

define ESP_EARLY_LOGW

#define ESP_EARLY_LOGW (
    tag,
    ...
) LT_W(__VA_ARGS__)

define ESP_LOGD

#define ESP_LOGD (
    tag,
    ...
) LT_D(__VA_ARGS__)

define ESP_LOGE

#define ESP_LOGE (
    tag,
    ...
) LT_E(__VA_ARGS__)

define ESP_LOGI

#define ESP_LOGI (
    tag,
    ...
) LT_I(__VA_ARGS__)

define ESP_LOGV

#define ESP_LOGV (
    tag,
    ...
) LT_V(__VA_ARGS__)

define ESP_LOGW

#define ESP_LOGW (
    tag,
    ...
) LT_W(__VA_ARGS__)

define ETS_PRINTF

#define ETS_PRINTF (
    ...
) LT_I(__VA_ARGS__)

define LT_D

#define LT_D (
    ...
) LT_LOG(LT_LEVEL_DEBUG, __FUNCTION__, __LINE__, __VA_ARGS__)

define LT_DM

#define LT_DM (
    module,
    ...
) LT_LOGM(LT_LEVEL_DEBUG, module, __FUNCTION__, __LINE__, __VA_ARGS__)

define LT_E

#define LT_E (
    ...
) LT_LOG(LT_LEVEL_ERROR, __FUNCTION__, __LINE__, __VA_ARGS__)

define LT_EM

#define LT_EM (
    module,
    ...
) LT_LOGM(LT_LEVEL_ERROR, module, __FUNCTION__, __LINE__, __VA_ARGS__)

define LT_ERRNO

#define LT_ERRNO (

) 

define LT_ERRNO_LEZ

#define LT_ERRNO_LEZ (
    ret
) if (ret <= 0) {                                                                                                    \
        LT_E("errno=%d, ret=%d", errno, ret);                                                                          \
        return ret;                                                                                                    \
    }

define LT_ERRNO_LZ

#define LT_ERRNO_LZ (
    ret
) if (ret < 0) {                                                                                                     \
        LT_E("errno=%d, ret=%d", errno, ret);                                                                          \
        return ret;                                                                                                    \
    }

define LT_ERRNO_NZ

#define LT_ERRNO_NZ (
    ret
) if (ret) {                                                                                                         \
        LT_E("errno=%d, ret=%d", errno, ret);                                                                          \
        return ret;                                                                                                    \
    }

define LT_F

#define LT_F (
    ...
) LT_LOG(LT_LEVEL_FATAL, __FUNCTION__, __LINE__, __VA_ARGS__)

define LT_FM

#define LT_FM (
    module,
    ...
) LT_LOGM(LT_LEVEL_FATAL, module, __FUNCTION__, __LINE__, __VA_ARGS__)

define LT_HEAP_I

#define LT_HEAP_I (

) 

define LT_I

#define LT_I (
    ...
) LT_LOG(LT_LEVEL_INFO, __FUNCTION__, __LINE__, __VA_ARGS__)

define LT_IM

#define LT_IM (
    module,
    ...
) LT_LOGM(LT_LEVEL_INFO, module, __FUNCTION__, __LINE__, __VA_ARGS__)

define LT_LOG

#define LT_LOG (
    level,
    caller,
    line,
    ...
) lt_log(level, __VA_ARGS__)

define LT_LOGM

#define LT_LOGM (
    level,
    module,
    caller,
    line,
    ...
) do {                                                                                                               \
        if (LT_DEBUG_##module) {                                                                                       \
            lt_log(level, #module ": " __VA_ARGS__);                                                                   \
        }                                                                                                              \
    } while (0)

define LT_RET

#define LT_RET (
    ret
) LT_E("ret=%d", ret);                                                                                               \
    return ret;

define LT_RET_LEZ

#define LT_RET_LEZ (
    ret
) if (ret <= 0) {                                                                                                    \
        LT_E("ret=%d", ret);                                                                                           \
        return ret;                                                                                                    \
    }

define LT_RET_LZ

#define LT_RET_LZ (
    ret
) if (ret < 0) {                                                                                                     \
        LT_E("ret=%d", ret);                                                                                           \
        return ret;                                                                                                    \
    }

define LT_RET_NZ

#define LT_RET_NZ (
    ret
) if (ret) {                                                                                                         \
        LT_E("ret=%d", ret);                                                                                           \
        return ret;                                                                                                    \
    }

define LT_T

#define LT_T (
    ...
) LT_LOG(LT_LEVEL_TRACE, __FUNCTION__, __LINE__, __VA_ARGS__)

define LT_TM

#define LT_TM (
    module,
    ...
) LT_LOGM(LT_LEVEL_TRACE, module, __FUNCTION__, __LINE__, __VA_ARGS__)

define LT_V

#define LT_V (
    ...
) LT_LOG(LT_LEVEL_TRACE, __FUNCTION__, __LINE__, __VA_ARGS__)

define LT_VM

#define LT_VM (
    module,
    ...
) LT_LOGM(LT_LEVEL_TRACE, module, __FUNCTION__, __LINE__, __VA_ARGS__)

define LT_W

#define LT_W (
    ...
) LT_LOG(LT_LEVEL_WARN, __FUNCTION__, __LINE__, __VA_ARGS__)

define LT_WM

#define LT_WM (
    module,
    ...
) LT_LOGM(LT_LEVEL_WARN, module, __FUNCTION__, __LINE__, __VA_ARGS__)

define ets_printf

#define ets_printf (
    ...
) LT_I(__VA_ARGS__)

define isr_log_d

#define isr_log_d (
    ...
) LT_D(__VA_ARGS__)

define isr_log_e

#define isr_log_e (
    ...
) LT_E(__VA_ARGS__)

define isr_log_i

#define isr_log_i (
    ...
) LT_I(__VA_ARGS__)

define isr_log_n

#define isr_log_n (
    ...
) LT_E(__VA_ARGS__)

define isr_log_v

#define isr_log_v (
    ...
) LT_V(__VA_ARGS__)

define isr_log_w

#define isr_log_w (
    ...
) LT_W(__VA_ARGS__)

define log_d

#define log_d (
    ...
) LT_D(__VA_ARGS__)

define log_e

#define log_e (
    ...
) LT_E(__VA_ARGS__)

define log_i

#define log_i (
    ...
) LT_I(__VA_ARGS__)

define log_n

#define log_n (
    ...
) LT_E(__VA_ARGS__)

define log_printf

#define log_printf (
    ...
) LT_I(__VA_ARGS__)

define log_v

#define log_v (
    ...
) LT_V(__VA_ARGS__)

define log_w

#define log_w (
    ...
) LT_W(__VA_ARGS__)

The documentation for this class was generated from the following file cores/common/base/lt_logger.h