TurtleBrains  0.3.1
High quality, portable, C++ framework for rapid 2D game development.
Debug Log Macros

Macros

#define tb_log_open(logFile, createConsoleWindow)   TurtleBrains::Core::Debug::OpenLog(logFile, createConsoleWindow)
 
#define tb_log_save()   TurtleBrains::Core::Debug::SaveLog()
 
#define tb_log_close()   TurtleBrains::Core::Debug::CloseLog()
 
#define tb_log(formattedMessage, ...)   TurtleBrains::Core::Debug::Log(formattedMessage, ##__VA_ARGS__)
 
#define tb_log_if(testResult, formattedMessage, ...)   TurtleBrains::Core::Debug::LogIf((testResult), formattedMessage, ##__VA_ARGS__)
 
#define tb_debug_project_entry_point(entryPoint)   TurtleBrains::Core::Debug::ProjectEntryPoint(entryPoint);
 
#define tb_debug_project_entry_point_with(entryPoint, argumentCount, argumentValues)   TurtleBrains::Core::Debug::ProjectEntryPoint(entryPoint, argumentCount, argumentValues);
 

Detailed Description

Macro Definition Documentation

#define tb_debug_project_entry_point (   entryPoint)    TurtleBrains::Core::Debug::ProjectEntryPoint(entryPoint);

Setups a special exception handler on Windows built with Visual CPP that will create a crash report with a callstack when an exception is thrown and caught within. For other platforms and compilers the exception will be caught but no crash report will be created as far as TurlteBrains v0.2.0. Hopeful future support.

Underneath this simply calls the Debug::ProjectEntryPoint() function, however the define should be preferred when you want to have the option of turning off all logging with the tb_without_debug_set define in the tb_configuration.h file.

Parameters
entryPointA function pointer to a function that takes no parameters and returns no parameters, void foo(void); that will be called after setting up an exception handler to create a crash report.
#define tb_debug_project_entry_point_with (   entryPoint,
  argumentCount,
  argumentValues 
)    TurtleBrains::Core::Debug::ProjectEntryPoint(entryPoint, argumentCount, argumentValues);

Setups a special exception handler on Windows built with Visual CPP that will create a crash report with a callstack when an exception is thrown and caught within. For other platforms and compilers the exception will be caught but no crash report will be created as far as TurlteBrains v0.2.0. Hopeful future support.

Underneath this simply calls the Debug::ProjectEntryPoint() function, however the define should be preferred when you want to have the option of turning off all logging with the tb_without_debug_set define in the tb_configuration.h file.

Parameters
entryPointA function pointer to a function that takes an argumentCount and values parameters just like the would be passed to a main and returns an int: int foo(int c, char* v[]); that will be called after setting up an exception handler to create a crash report.
argumentCountThe number of values in the argumentValues array, typically just pass the same argumentCount you would get from main(int c, char* v[]);
argumentValuesThe actual values of each argument as null-terminated strings, typically just pass the same argumentValues you would get from main(int c, char* v[]);
#define tb_log (   formattedMessage,
  ... 
)    TurtleBrains::Core::Debug::Log(formattedMessage, ##__VA_ARGS__)

Writes a message into the log, the message can be a formatted string behaving exactly like printf would. Underneath this simply calls the Debug::CloseLog() function, however the define should be preferred when you want to have the option of turning off all logging with the tb_without_debug_set define in tb_configuration.h

Parameters
formattedMessageA string of characters of a formatted string that describes the variable arguments that follow. The formatted message and arguments are used exactly like printf() would be.
...The variable arguments the fill in the formattedMessage string using the same printf() format.
#define tb_log_close ( )    TurtleBrains::Core::Debug::CloseLog()

Closes the log file after flushing any pending log messages, once closed any new log messages will not be written to the log file, only to the stdout. Underneath this simply calls the Debug::CloseLog() function, however the define should be preferred when you want to have the option of turning off all logging with the tb_without_debug_set define in tb_configuration.h

#define tb_log_if (   testResult,
  formattedMessage,
  ... 
)    TurtleBrains::Core::Debug::LogIf((testResult), formattedMessage, ##__VA_ARGS__)

Writes a message into the log, the message can be a formatted string behaving exactly like printf would, but does so only if the testResult is true. If test result is false no message gets displayed on stdout or the log. Underneath this simply calls the Debug::CloseLog() function, however the define should be preferred when you want to have the option of turning off all logging with the tb_without_debug_set define in tb_configuration.h

Parameters
testResultAn expression that will result in a boolean, true or false, result. If true the message will output in the log and stdout, otherwise it will not be displayed.
formattedMessageA string of characters of a formatted string that describes the variable arguments that follow. The formatted message and arguments are used exactly like printf() would be.
...The variable arguments the fill in the formattedMessage string using the same printf() format.
#define tb_log_open (   logFile,
  createConsoleWindow 
)    TurtleBrains::Core::Debug::OpenLog(logFile, createConsoleWindow)

Opens a file to output the log at, and can, on Windows building with Visual CPP, open a console window for showing std out if the console parameter is passed as true. Underneath this simply calls the Debug::OpenLog() function, however the define should be preferred when you want to have the option of turning off all logging with the tb_without_debug_set define in tb_configuration.h

Parameters
logFileThe filepath of the location to save the log file. This file will be cleared when loaded so the contents will only show a single run.
createConsoleWindowSet to true this will attempt to create a console window. Currently only supported on Windows when building with Visual CPP.
#define tb_log_save ( )    TurtleBrains::Core::Debug::SaveLog()

Saves the log file to disk to make sure any log messages have been flushed. Underneath this simply calls the Debug::SaveLog() function, however the define should be preferred when you want to have the option of turning off all logging with the tb_without_debug_set define in tb_configuration.h