AmendHub

Download:

ftech

/

Logger

/

amendments

/

5

Updated README


Francois Techene made amendment 5 10 days ago
--- README Tue Apr 8 09:49:59 2025 +++ README Tue Apr 8 14:39:25 2025 @@ -20,21 +20,26 @@ The Logger library requires ANSI to be added to your p For the logger to log to the console (through printf()), call the init_logger() function with a log level and `CONSOLE_OUT` as the output method. init_logger(ERROR_LEVEL, - CONSOLE_OUT, - NULL); + CONSOLE_OUT, + NULL); For the logger to log to a file, call the init_logger() function with the FILE_OUT as the output method along with the path to the file to log to. init_logger(DEBUG_LEVEL, - FILE_OUT, - "file.log"); + FILE_OUT, + "file.log"); -A simple file name like "file.log" will log to a file in the current project folder. -You can use a full path as follow: "Macintosh HD:Logs:my_project.log". +You can define paths as follow: +* "file.log" - A simple file name relative to the project. +* ":logs:file.log" - An path relative to the project. +* "Macintosh HD:logs:file.log" - An absolute path. + Tip: The log file can be stored on a network volume (from Netatalk) and loaded with `tail -f` on a modern machine so that logs are shown in real time. -Note that the log file is not created. It needs to exist on the drive. It is cleared every time init_logger() is called. +Note that if the log file doesn't exist, it is created but only if its containg folder exists. +If the file cannot be created, the output method is set to NONE_OUT. +The log file is cleared every time init_logger() is called. Log output methods are as follow: