ascii-chat
Binary v0.16.50-198-g78f51665f
Library lib/v0.3.2-2240-g78f51665f
Video chat in your terminal
Loading...
Searching...
No Matches
format.c File Reference

Log format parser implementation. More...

Go to the source code of this file.

Macros

#define LOG_FORMAT_STRFTIME_LITERAL_MAX   64
#define LOG_FORMAT_FORMAT_BUFFER_SIZE   (1 + LOG_FORMAT_STRFTIME_LITERAL_MAX + 1)
#define LOG_FORMAT_LEVEL_NAME_BUFFER_SIZE   32
#define LOG_FORMAT_CONTENT_BUFFER_SIZE   512

Functions

log_template_t * log_template_parse (const char *format_str, bool console_only)
 Parse a format string into compiled format structure.
void log_template_free (log_template_t *format)
 Free compiled format structure.
int log_template_apply (const log_template_t *format, char *buf, size_t buf_size, log_level_t level, const char *timestamp, const char *file, int line, const char *func, uint64_t tid, const char *message, bool use_colors, uint64_t time_nanoseconds)
 Apply format to a log entry and write result to buffer.

Detailed Description

Log format parser implementation.

Definition in file log/format.c.

Macro Definition Documentation

◆ LOG_FORMAT_CONTENT_BUFFER_SIZE

#define LOG_FORMAT_CONTENT_BUFFER_SIZE   512

Definition at line 11 of file log/format.c.

Referenced by log_template_apply().

◆ LOG_FORMAT_FORMAT_BUFFER_SIZE

#define LOG_FORMAT_FORMAT_BUFFER_SIZE   (1 + LOG_FORMAT_STRFTIME_LITERAL_MAX + 1)

Definition at line 9 of file log/format.c.

Referenced by log_template_apply().

◆ LOG_FORMAT_LEVEL_NAME_BUFFER_SIZE

#define LOG_FORMAT_LEVEL_NAME_BUFFER_SIZE   32

Definition at line 10 of file log/format.c.

Referenced by log_template_apply().

◆ LOG_FORMAT_STRFTIME_LITERAL_MAX

#define LOG_FORMAT_STRFTIME_LITERAL_MAX   64

Definition at line 8 of file log/format.c.

Referenced by log_template_apply().