Skip to content

File espos_log.h

FileList > espos_log > include > espos_log.h

Go to the source code of this file

  • #include <stdbool.h>
  • #include <stddef.h>
  • #include <stdint.h>
  • #include "esp_err.h"

Classes

Type Name
struct espos_log_stats_t

Public Types

Type Name
typedef void(* espos_log_notify_cb_t
Called (from a timer task, never from the logging call itself) at most every ESPOS_LOG_NOTIFY_MS when new lines arrived.
typedef bool(* espos_log_visit_cb_t
Visit lines with seq > after, oldest first, at most limit (0 = all).

Public Functions

Type Name
void espos_log_deinit (void)
Uninstall the hook (tests).
esp_err_t espos_log_init (void)
Install the hook.
const char * espos_log_level_name (int level)
size_t espos_log_read (uint32_t after, size_t limit, espos_log_visit_cb_t cb, void * arg)
esp_err_t espos_log_set_level (const char * tag, const char * level)
Set a tag's (or "*") log level by name: none error warn info debug verbose.
void espos_log_set_notify (espos_log_notify_cb_t cb, void * arg)
void espos_log_stats (espos_log_stats_t * out)

Public Types Documentation

typedef espos_log_notify_cb_t

Called (from a timer task, never from the logging call itself) at most every ESPOS_LOG_NOTIFY_MS when new lines arrived.

typedef void(* espos_log_notify_cb_t) (uint32_t next_seq, void *arg);


typedef espos_log_visit_cb_t

Visit lines with seq > after, oldest first, at most limit (0 = all).

typedef bool(* espos_log_visit_cb_t) (uint32_t seq, const char *line, size_t len, void *arg);

The callback runs with the ring locked: copy, do not log, do not block. Return false from the callback to stop early. Returns the number of lines visited.


Public Functions Documentation

function espos_log_deinit

Uninstall the hook (tests).

void espos_log_deinit (
    void
) 

The ring content is freed.


function espos_log_init

Install the hook.

esp_err_t espos_log_init (
    void
) 

Idempotent. Lines logged before this call are lost.


function espos_log_level_name

const char * espos_log_level_name (
    int level
) 

function espos_log_read

size_t espos_log_read (
    uint32_t after,
    size_t limit,
    espos_log_visit_cb_t cb,
    void * arg
) 

function espos_log_set_level

Set a tag's (or "*") log level by name: none error warn info debug verbose.

esp_err_t espos_log_set_level (
    const char * tag,
    const char * level
) 


function espos_log_set_notify

void espos_log_set_notify (
    espos_log_notify_cb_t cb,
    void * arg
) 

function espos_log_stats

void espos_log_stats (
    espos_log_stats_t * out
) 


The documentation for this class was generated from the following file espos_log/include/espos_log.h