26 offsetof(options_t, log_file),
29 "Set FILE as path for log file (default: /tmp/ascii-chat-<mode>.log or Windows temp dir).",
33 "ASCII_CHAT_LOG_FILE",
44 offsetof(options_t, log_level),
45 &default_log_level_value,
47 "Set log level: dev, debug, info, warn, error, fatal. Logs at or above this level are written.",
51 "ASCII_CHAT_LOG_LEVEL",
60 .input_type = OPTION_INPUT_ENUM},
65 offsetof(options_t, verbose_level),
67 sizeof(
unsigned short int),
68 "Increase log verbosity (stackable: -VV, -VVV).",
83 offsetof(options_t, quiet),
86 "Disable console logging (log to file only).",
101 offsetof(options_t, grep_pattern),
104 "Filter console logs with perl compatible regular expressions or fixed strings. "
105 "Format 1: /pattern/flags (with flags). Format 2: pattern (plain regex, no flags). "
106 "Flags (format 1 only): i(case-insensitive), m(multiline), s(dotall), x(extended), g(global highlight), "
107 "I(invert match), F(fixed string), A<n>(n lines after), B<n>(n lines before), C<n>(n lines of context). "
108 "Examples: '/error/i', 'error', '/panic/C5', 'warn|error', '/buffer pool/Fg'. Multiple --grep allowed (OR).",
118 {.examples = (
const char *[]){
"ERROR",
"client\\.c",
"network.*failed", NULL}},
123 offsetof(options_t, color_scheme_name),
124 OPT_COLOR_SCHEME_NAME_DEFAULT,
125 sizeof(((options_t *)0)->color_scheme_name),
126 "Color scheme for logging output. Built-in schemes: pastel, nord, solarized, dracula, gruvbox, "
127 "monokai, base16-default. All schemes with light variants auto-adapt to terminal background.",
131 "ASCII_CHAT_COLOR_SCHEME",
137 {.input_type = OPTION_INPUT_STRING},
142 offsetof(options_t, json),
145 "Enable JSON logging (machine-readable NDJSON format). Disabled by default (text format).",
160 offsetof(options_t, log_template),
162 sizeof(((options_t *)0)->log_template),
163 "Custom log format string. Format specifiers: %time(fmt) - time with strftime format (see 'man 3 strftime' for "
164 "codes like %Y, %m, %d, %H, %M, %S); "
165 "%level - log level (DEV/DEBUG/INFO/WARN/ERROR/FATAL); %level_aligned - level padded to 5 chars; "
166 "%file - full file path; %file_relative - file path relative to project root; %line - line number; "
167 "%func - function name; %tid - thread ID; %message - log message; "
168 "%color(LEVEL, text) - colorize text using LEVEL's color from current scheme (e.g., %color(INFO, %tid)). "
169 "Example: '[%time(%Y-%m-%d %H:%M:%S)] [%level_aligned] %file_relative:%line %message'. "
170 "Escape %% for literal %, \\\\ for literal backslash. "
171 "Default: release mode '[%time(%H:%M:%S)] [%level_aligned] %message' or debug mode '[%time(%H:%M:%S)] "
172 "[%level_aligned] [tid:%tid] %file_relative:%line in %func(): %message'.",
176 "ASCII_CHAT_LOG_TEMPLATE",
182 {.input_type = OPTION_INPUT_STRING},
184 {
"log-format-console",
187 offsetof(options_t, log_format_console_only),
190 "Apply custom log template (--log-template) only to console output (file logs use default format). See "
192 "for supported format specifiers.",
196 "ASCII_CHAT_LOG_FORMAT_CONSOLE",
205 REGISTRY_TERMINATOR()};