FujiAPI / Fuji

Celeste 64 Mod Loader
30 stars 10 forks source link

Adding new LogHelper class to improve logging #86

Closed jasminegamedev closed 4 months ago

jasminegamedev commented 4 months ago

This adds a new LogHelper class to improve logging within the game. It wraps Foster's Logger, but now will add extra "[Warning]" and "[Error]" strings to warnings and errors to better highlight those areas. when logging to console, it will also highlight them in yellow or red. The WriteToLog and OpenLog functions were also moved to the LogHelper class to centralize things. It also includes a new error wrapper.

Small note: Unfortunately, the Error and Warning functions don't work entirely correctly due to a bug with Foster, where some Error and Warning function overloads were pointing to the wrong functions. This has already been fixed, but is not in a release yet. This should get fixed automatically next time Foster pushes a new release, and we update to use it. For now, if people would like to use this, they should also be able to call LogHelper.Error directly instead of Log.Error, which should give the proper handling. https://github.com/FosterFramework/Foster/commit/8ad29878ff9260168bfb0a54522175ef0e836f9b https://github.com/FosterFramework/Foster/commit/822fa8c8a5e02c4ac85a63d38983ce9bd7fb6f37