-
Notifications
You must be signed in to change notification settings - Fork 0
Logger Info
Currently this documentation is merely for our own development needs. It may be helpful for others to understand the code though.
The logger class will be a pre-built solution for other classes that don't want to handle logging themselves. While possibly causing some data redundancy and extra bussing it has currently been deemed useful enough to include.
The logger system will take data from the dispatcher system with the following data in each packet:
- Routing number
- The module's name
- A marker for if it is a general log or error log
- The data to be logged
- If the module wants its own log file.
The final format for a log request coming from a module should then be as such:
[8, [9, "MODULENAME", X, Y, data]]
Where X is either 0 or 1, 0 being for non-errors and 1 for errors, and Y is either 0, 1, or 2, 0 being for data stored in the main log file and 1 being stored in the module's log file while 2 is both. There will be a global variable set by the user that toggles the ability for modules to save to the main log file. If it is inactive all logs will go to the module logs.
Each module will need to have a variable in the main class that specifies how exactly it desires to save the logs. The main options at present will be:
- Append to the same file
- Make a new file each session
- Make new files on a set schedule