|
ascii-chat 0.8.38
Real-time terminal-based video chat with ASCII art conversion
|
Lock-free memory-mapped text logging implementation. More...
Go to the source code of this file.
Functions | |
| void | log_mmap_install_crash_handlers (void) |
| asciichat_error_t | log_mmap_init (const log_mmap_config_t *config) |
| asciichat_error_t | log_mmap_init_simple (const char *log_path, size_t max_size) |
| void | log_mmap_destroy (void) |
| void | log_mmap_write (int level, const char *file, int line, const char *func, const char *fmt,...) |
| bool | log_mmap_is_active (void) |
| void | log_mmap_sync (void) |
| void | log_mmap_get_stats (uint64_t *bytes_written, uint64_t *wrap_count) |
| bool | log_mmap_get_usage (size_t *used, size_t *capacity) |
| void | log_mmap_rotate (void) |
Lock-free memory-mapped text logging implementation.
Writes human-readable log text directly to a memory-mapped file. On crash, the log file is immediately readable with cat/tail.
Definition in file mmap.c.
| void log_mmap_destroy | ( | void | ) |
Definition at line 260 of file mmap.c.
References log_mmap_write().
Referenced by log_destroy(), log_disable_mmap(), and log_mmap_init().
| void log_mmap_get_stats | ( | uint64_t * | bytes_written, |
| uint64_t * | wrap_count | ||
| ) |
Definition at line 400 of file mmap.c.
References bytes_written, and wrap_count.
| bool log_mmap_get_usage | ( | size_t * | used, |
| size_t * | capacity | ||
| ) |
| asciichat_error_t log_mmap_init | ( | const log_mmap_config_t * | config | ) |
Definition at line 191 of file mmap.c.
References log_mmap_destroy(), log_mmap_install_crash_handlers(), and log_mmap_write().
Referenced by log_mmap_init_simple().
| asciichat_error_t log_mmap_init_simple | ( | const char * | log_path, |
| size_t | max_size | ||
| ) |
Definition at line 252 of file mmap.c.
References log_mmap_init().
Referenced by log_enable_mmap_sized(), and log_init().
| void log_mmap_install_crash_handlers | ( | void | ) |
Definition at line 144 of file mmap.c.
Referenced by log_mmap_init().
| bool log_mmap_is_active | ( | void | ) |
Definition at line 390 of file mmap.c.
Referenced by log_destroy(), log_disable_mmap(), log_file_msg(), log_msg(), and log_plain_msg().
| void log_mmap_rotate | ( | void | ) |
Definition at line 423 of file mmap.c.
| void log_mmap_sync | ( | void | ) |
| void log_mmap_write | ( | int | level, |
| const char * | file, | ||
| int | line, | ||
| const char * | func, | ||
| const char * | fmt, | ||
| ... | |||
| ) |
Definition at line 312 of file mmap.c.
References ansi_strip_escapes(), args, safe_snprintf(), and safe_vsnprintf().
Referenced by log_file_msg(), log_mmap_destroy(), log_mmap_init(), log_msg(), and log_plain_msg().
| _Atomic uint64_t bytes_written |
Definition at line 42 of file mmap.c.
Referenced by gpg_get_public_key(), gpg_verify_signature_with_binary(), log_mmap_get_stats(), ssh_agent_add_key(), and ssh_agent_has_key().
| char file_path[PLATFORM_MAX_PATH_LENGTH] |
Definition at line 39 of file mmap.c.
Referenced by asciichat_instr_log_line(), colorscheme_export_scheme(), discovery_keys_load_file(), and log_recolor_plain_entry().
| bool initialized |
Definition at line 38 of file mmap.c.
Referenced by registry_init_from_builders(), and test_get_binary_path().
| _Atomic uint64_t wrap_count |
Definition at line 43 of file mmap.c.
Referenced by log_mmap_get_stats().
| _Atomic uint64_t write_pos |
Definition at line 37 of file mmap.c.
Referenced by session_log_buffer_get_recent().