void clear_file_logger(file_logger *fhl)
free resources for the file ogger
void clear_thread_logger(thread_logger *thl)
free resources for the threaded logger
void(* log_fnf)(struct thread_logger *thl, int file_descriptor, LOG_LEVELS level, char *message,...)
void error_log(thread_logger *thl, int file_descriptor, char *message)
logs an error styled message - called by log_fn
file_logger * new_file_logger(char *output_file, bool with_debug)
returns a new file_logger Calls new_thread_logger internally
void(* log_fn)(struct thread_logger *thl, int file_descriptor, char *message, LOG_LEVELS level)
void logf_func(thread_logger *thl, int file_descriptor, LOG_LEVELS level, char *message,...)
like log_func but for formatted logs
void info_log(thread_logger *thl, int file_descriptor, char *message)
logs an info styled message - called by log_fn
int write_file_log(int file_descriptor, char *message)
used to write a log message to file
struct thread_logger thread_logger
macros and utilities for printing color to stdout from https://www.quora.com/How-do-I-print-a-colored...
void log_func(thread_logger *thl, int file_descriptor, char *message, LOG_LEVELS level)
main function you should call, which will delegate to the appopriate *_log function
thread_logger * new_thread_logger(bool with_debug)
returns a new thread safe logger if with_debug is false, then all debug_log calls will be ignored
struct file_logger file_logger
void warn_log(thread_logger *thl, int file_descriptor, char *message)
logs a warned styled message - called by log_fn
void debug_log(thread_logger *thl, int file_descriptor, char *message)
logs a debug styled message - called by log_fn
int(* mutex_fn)(pthread_mutex_t *mx)