Skip to content

Adding new LogHelper class to improve logging - #86

Merged
jasminegamedev merged 1 commit into
devfrom
better-logging
May 2, 2024
Merged

jasminegamedev merged 1 commit into
devfrom
better-logging

Conversation

@jasminegamedev

Copy link
Copy Markdown
Collaborator

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

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
@jasminegamedev jasminegamedev added this to the 0.7.0 blockers milestone May 2, 2024
@jasminegamedev jasminegamedev self-assigned this May 2, 2024
@jasminegamedev
jasminegamedev marked this pull request as ready for review May 2, 2024 04:42
@jasminegamedev
jasminegamedev merged commit f4d4a8e into dev May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant