Go to the source code of this file.
◆ log_timestamp_format_func_t
Prototype of the function that will apply custom formatting to a timestamp when LOG_OUTPUT_FORMAT_CUSTOM_TIMESTAMP.
Example function:
int custom_timestamp_formatter(
const struct log_output* output,
return printer(output, "%d ", timestamp);
}
uint32_t log_timestamp_t
Definition: log_msg.h:36
int(* log_timestamp_printer_t)(const struct log_output *output, const char *fmt,...)
Prototype of a printer function that can print the given timestamp into a specific logger instance.
Definition: log_output_custom.h:55
Log_output instance structure.
Definition: log_output.h:96
- Parameters
-
output | The logger instance to write to |
timestamp | |
printer | The printing function to use when formatting the timestamp. |
◆ log_timestamp_printer_t
typedef int(* log_timestamp_printer_t) (const struct log_output *output, const char *fmt,...) |
Prototype of a printer function that can print the given timestamp into a specific logger instance.
Example usage:
printer(log_instance, "%02u:%02u", hours, minutes);
- Parameters
-
output | The logger instance to write to |
fmt | The format string |
... | optional arguments for the format string |
◆ log_custom_output_msg_set()
Set the formatting log function that will be applied with LOG_OUTPUT_CUSTOM.
- Parameters
-
format | Pointer to the external formatter function |
◆ log_custom_timestamp_print()
Format the timestamp with a external function.
Function is using provided context with the buffer and output function to process formatted string and output the data.
- Parameters
-
output | Pointer to the log output instance. |
timestamp | |
printer | The printing function to use when formatting the timestamp. |
◆ log_custom_timestamp_set()
Set the timestamp formatting function that will be applied when LOG_OUTPUT_FORMAT_CUSTOM_TIMESTAMP.
- Parameters
-
format | Pointer to the external formatter function |