Kicking it Olde Sküül! Burgerlib on Github Follow Olde Sküül on Twitter Burgerbecky on LinkedIn Burgerbecky on LinkedIn
Loading...
Searching...
No Matches
Functions
Burger::Debug Namespace Reference

Group of functions to assist in debugging. More...

Functions

uint_t Fatal (const char *pMessage,...) noexcept
 A fatal error has occurred, print message, then exit.
 
void Warning (const char *pMessage,...) noexcept
 Store a non-fatal error message, then return or exit.
 
void Message (const char *pMessage,...) noexcept
 Print a message to the debugger output stream.
 
void PrintString (const char *pMessage) noexcept
 Print a string to a file or debugger.
 
void PrintString (uint32_t uInput) noexcept
 Print a uint32_t to the debug port.
 
void PrintString (uint64_t uInput) noexcept
 Print a uint64_t to the debug port.
 
void PrintErrorMessage (uint_t uErrorCode) noexcept
 Print the error message for an OS error code.
 

Detailed Description

Group of functions to assist in debugging.


These thread safe functions will print messages to the debug console of the attached debugger and if a debugger is not available, the output will be logged into a text file on applicable platforms.

See also
Globals

Function Documentation

◆ Fatal()

uint_t BURGER_ANSIAPI Burger::Debug::Fatal ( const char * pMessage,
... )
externnoexcept

A fatal error has occurred, print message, then exit.


If the input message pointer is not NULL, then print the message string using printf() rules.

This message, if any, will be output through Debug::Message() which either outputs it to a log file or a debugger's console (If a debugger is present and running).

Note
This will call Globals::Shutdown() with a default error code of 1. You must call Globals::SetErrorCode() to change the code to something else.

Secondly, this function won't return unless it was called while Globals::Shutdown() was already invoked, then this function CAN return, so you must add a return statement after calling this function in the case that there is a recursion error in progress.

if (TestError) {
Debug::Fatal("Fatal error, file %s was not found.",pFileName);
return;
}
uint_t Fatal(const char *pMessage,...) noexcept
A fatal error has occurred, print message, then exit.
Definition brdebug.cpp:78
Select a type based if the conditional is true or false.
Definition burger.h:3178
Parameters
pMessagePointer to a string suitable for printf or NULL.
Returns
0 if this function returns. In most cases, this function never returns.
See also
Debug::Warning, Globals::GetExitFlag() and Globals::Shutdown()

◆ Message()

void BURGER_ANSIAPI Burger::Debug::Message ( const char * pMessage,
... )
externnoexcept

Print a message to the debugger output stream.


Given a "printf()" message string and parameters, print the message to the output stream, which is a console or an attached debugger

See also
Debug::PrintString(const char *), Debug::PrintString(uint32_t) and Debug::PrintString(uint64_t)

◆ PrintErrorMessage()

void BURGER_API Burger::Debug::PrintErrorMessage ( uint_t uErrorCode)
externnoexcept

Print the error message for an OS error code.


Given an error code from the native operating system and print it out the Debug messaging system.

Parameters
uErrorCodeError code from Windows/MacOS/etc...

◆ PrintString() [1/3]

void BURGER_API Burger::Debug::PrintString ( const char * pString)
externnoexcept

Print a string to a file or debugger.


Given a "C" string, stream the data to a text file, or if a debugger is attached, to the debugger console.

No parsing is done on the string, it's written as is.

Parameters
pStringPointer to a "C" string to print.

◆ PrintString() [2/3]

void BURGER_API Burger::Debug::PrintString ( uint32_t uInput)
externnoexcept

Print a uint32_t to the debug port.


See also
Debug::PrintString(uint64_t)

◆ PrintString() [3/3]

void BURGER_API Burger::Debug::PrintString ( uint64_t uInput)
externnoexcept

Print a uint64_t to the debug port.


See also
Debug::PrintString(uint32_t)

◆ Warning()

void BURGER_ANSIAPI Burger::Debug::Warning ( const char * pMessage,
... )
externnoexcept

Store a non-fatal error message, then return or exit.


If the input message pointer is not NULL, then store the message string into the global error string buffer using printf() rules. If it's nullptr, do nothing to the error message buffer.

If Globals::SetErrorCode() was called with TRUE, this function will then treat this warning as an error and call Debug::Fatal( const char *pFatalMsg,...) and exit.

if (TestError) {
Debug::Warning("Warning, file %s was not found.",pFileName);
return;
}
void Warning(const char *pMessage,...) noexcept
Store a non-fatal error message, then return or exit.
Definition brdebug.cpp:138
Note
The standard behavior is to store the text string and immediately return. Only if an explicit call to Globals::SetErrorCode() setting it TRUE will change the operation of this procedure.
Parameters
pMessagePointer to a string suitable for printf or nullptr.
See also
Debug::Fatal(const char *pFatalMsg,...)