ascii-chat 0.6.0
Real-time terminal-based video chat with ASCII art conversion
Loading...
Searching...
No Matches
report.c File Reference

Go to the source code of this file.

Data Structures

struct  thread_filter_list
 
struct  report_config
 
struct  log_record
 
struct  thread_entry
 

Typedefs

typedef struct thread_filter_list thread_filter_list_t
 
typedef struct report_config report_config_t
 
typedef struct log_record log_record_t
 
typedef struct thread_entry thread_entry_t
 

Functions

int main (int argc, char **argv)
 

Typedef Documentation

◆ log_record_t

typedef struct log_record log_record_t

◆ report_config_t

◆ thread_entry_t

typedef struct thread_entry thread_entry_t

◆ thread_filter_list_t

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 615 of file report.c.

615 {
616 report_config_t config = {
617 .log_dir = NULL,
618 .log_file = NULL,
619 .include_filter = NULL,
620 .exclude_filter = NULL,
621 .threads = {.values = NULL, .count = 0, .capacity = 0},
622 .emit_raw_line = false,
623 };
624
625 log_init(NULL, LOG_INFO, false, false);
626
627 int exit_code = EXIT_SUCCESS;
628 if (!parse_arguments(argc, argv, &config)) {
629 exit_code = ERROR_USAGE;
630 goto cleanup;
631 }
632
633 thread_entry_t *entries = NULL;
634 if (!collect_entries(&config, &entries)) {
635 exit_code = ERROR_GENERAL;
636 destroy_entries(&entries);
637 goto cleanup;
638 }
639
640 print_summary(&config, &entries);
641 destroy_entries(&entries);
642
643cleanup:
644 thread_filter_list_destroy(&config.threads);
645 log_destroy();
646 return exit_code;
647}
@ ERROR_GENERAL
Definition error_codes.h:49
@ ERROR_USAGE
Definition error_codes.h:50
void log_destroy(void)
Destroy the logging system and close log file.
void log_init(const char *filename, log_level_t level, bool force_stderr, bool use_mmap)
Initialize the logging system.
@ LOG_INFO
Definition log/logging.h:62
thread_filter_list_t threads
Definition report.c:41
const char * log_dir
Definition report.c:37
Definition report.c:59

References ERROR_GENERAL, ERROR_USAGE, log_destroy(), report_config::log_dir, LOG_INFO, log_init(), and report_config::threads.