LexouDuck / libccc

A customizable cross-platform standard library for C
MIT License
11 stars 1 forks source link

Add `Logger_Exit` to match current `NewLogger_*` functions #31

Open yanis-fourel opened 2 years ago

yanis-fourel commented 2 years ago

These NewLogger_* functions do not have a clear matching function to delete created logger. Solution:

//! Returns a logger for STDOUT. Should not be present twice per `t_atapi`.
s_logger        NewLogger_StdOut(
    t_bool          log_timestamp,
    t_bool          log_verbose,
    t_bool          log_obfuscated,
    e_logformat     log_format
);

//! Returns a logger for STDERR. Should not be present twice per `t_atapi`.
s_logger        NewLogger_StdErr(
    t_bool          log_timestamp,
    t_bool          log_verbose,
    t_bool          log_obfuscated,
    e_logformat     log_format
);

//! Create a new logger object from the specified settings
e_exception     NewLogger(s_logger *a_result,
    char const*     log_path,
    t_bool          log_silence_logs,
    t_bool          log_silence_errors,
    t_bool          log_timestamp,
    t_bool          log_verbose,
    t_bool          log_obfuscated,
    t_bool          log_append,
    e_logformat     log_format
);
Fulguritude commented 2 years ago

The NewLogger functions are found in the AvesTerra source folder. I would actually have the following behavior: