enum LogMessageType { LogMessage_Text = 0x00000, LogMessage_Warning = 0x20000, LogMessage_Error = 0x30000, LogMessage_Assert = 0x40000, LogMessage_Report = 0x50000, LogMessage_Mask = 0xF0000 };
LogMessageType describes the severity of log messages and automatic prefix/suffix that should be given to it.
LogMessageType bits are combined with LogChannel and an additional integer value to form LogMessageId.
Different log messages have separate purposes and should be used appropriately as follows:
Text |
General output of information to channel without prefix/newline. Debug-only messages should be combine with the LogChannel_Debug. |
Warning |
Warning messages should be emitted when the API is misused or is in such a state that the desired operation will most likely not perform as expected. However, the problem that caused the warning is still handled gracefully by the system and will not cause a crash. |
Error |
Error messages should be emitted if there is an internal problem that will cause a system or component to malfunction. These messages may be generated when certain critical resources (files, devices, memory) are not available or do not function properly. Error messages can also be generated if the condition is serious enough but will not be checked for in the release build (resource leak, for example). Note that conditions for these messages should not cause an immediate crash even in release build. |
Assert |
Assertion failures should be generated when the program data structure or parameter is in an invalid state that will cause an immediate failure or crash. Assertion failure usually indicates a program logic error or invalid use of an API (assert messages and should NOT be generated due to invalid user input or device/file states that can be handled more gracefully). Assert conditions will not be checked for in the release build and will most likely cause a crash. |
Members |
Description |
LogMessage_Text = 0x00000 |
No prefix, no newline. |
LogMessage_Warning = 0x20000 |
Log message with "Warning: " prefix. For unexpected conditions handled gracefully. |
LogMessage_Error = 0x30000 |
Log message with "Error: " prefix. For runtime errors resulting in API fail (but not crash). |
LogMessage_Assert = 0x40000 |
Log message with "Assert: " prefix. Used for condition leading to crash; debug only. |
LogMessage_Report = 0x50000 |
GFx specific message for reports (performance, memory, etc). |
LogMessage_Mask = 0xF0000 |
Bit mask used to extract LogMessageType. |
SF_Log.h