Closed WVAviator closed 8 months ago
Note that Tauri provides a path function for getting the recommend storage location for app logs. https://docs.rs/tauri/1.5.4/tauri/api/path/index.html
Logging to custom files based on the provided target is more challenging than originally anticipated. Basic logging is configured and working.
Add fern crate and create setup function to be called in main.rs before initializing the app.
Setup function should use multiple chained dispatchers (see https://docs.rs/fern/0.6.2/fern/struct.Dispatch.html) to log the following:
The log format should show the date and time for file logging only (consider using a crate like humantime as recommended by fern docs), the level and record prefixed for all other logs.
Consider setting up a yaml/JSON logger that, when invoked, saves these strings to their own files. Not sure how this could be configured or if it should just use the regular file management system. Maybe a pipe delineated record.target value (gameid|yaml) versus non delineated (gameid) could trigger this behavior.
Consider having the front end console logs routed to the back end as well, for convenience.
All existing logs should be revised to utilize the new logging setup.