Adding new LogHelper class to improve logging - #86
Merged
Merged
Conversation
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 Warnings 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 instead of Log.Error, which should give the proper handling. FosterFramework/Foster@8ad2987 FosterFramework/Foster@822fa8c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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. FosterFramework/Foster@8ad2987 FosterFramework/Foster@822fa8c