-
Notifications
You must be signed in to change notification settings - Fork 0
Logging Documentation
Voidless7125 edited this page Sep 18, 2024
·
1 revision
The log handler takes in the function name, log message, log level, and time of display as parameters.
To call the log handler function, you need to provide the following parameters:
- functionName: The name of the function/module where the log message is being generated.
- message: The log message to be displayed and logged.
- level: The log level (e.g., Trace, Debug, Info, Warn, Error, or Fatal).
- timeOfDisplay: The time duration in seconds for which the message should be displayed on the controller screen. (Optional)
loghandler("MyVeryGoodFuntion", "A very bad message", Log:;Level::Fatal, 2)
- The log handler function first logs the message into a file called "log.txt" if the configuration allows logging to a file.
- It also prints the log message, along with the time and module name, to the console in a colored format based on the log level.
If the log level is Warn, Error, or Fatal, the function displays the message on the controller screens for the specified duration. If the log level is Fatal, it also interrupts all threads and requests the system to exit the program.