Search
⌃K

Logging

Notify if something has happened
During development you will likely want to easily be notified if a relevant event during debugging has happened this is where logging comes in.
Logging is as simple as calling any variation of the BE_LOG_x(args...) macro. This macro will automatically be removed for any release type build.
The options are:
  • BE_LOG_SUCCESS()
    • Success is for logging any event which we are hoping will occur.
  • BE_LOG_MESSAGE()
    • Message is for logging any kind of generic information. Most engine logs are of this type, they mostly contain information which you'll want to look at after the fact to see which values were used where.
  • BE_LOG_WARNING()
    • Warning is for logging any kind of event which might be unwanted but doesn't cause any trouble. Such as performance issues or debug only cases.
  • BE_LOG_ERROR()
    • Error is for logging any kind of event which causes critical issues for the function of the application. All faults which are caught in debug builds but cause issues in release builds are signaled with this log, usually accompanied by the message. "Fix this issue as it leads to undefined behavior in release builds".
Logging macros accept utf8 strings, any integral type, and objects casteable to GTSL::StringView. To be able to print your own structures define a function like this.
void ToString(auto& string, YourType your_type) {
// serialization code
// ...
}
Any other type will cause compile errors.
These macros can only be used inside system functions.