I hope to add a little functionality to the log file system for the project I'm working on. For my calls, LogError()I would like to enable the function in which the error occurred. I am wondering if there is a way to access the name of a function called LogError()so that I can programmatically access this information in order to add this to the log.
For instance:
bool Engine::GraphicsManager::Initialize(const HWND i_hWindow_main)
{
if ( !InitializeWindow( i_hWindow_main ) )
{
Engine::LogManager::Instance().LogError(L"GraphicsManager::Initialize - Unable to initialize graphics window");
return false;
}
Engine::LogManager::Instance().LogMessage(L"Graphics window initialized successfully");
initialized = true;
return true;
}
In the above example, I would like to LogError()be able to determine that it was called from GraphicsManager::Initialize()and output (at least part) this function name instead of manually putting it in all directions.
EDIT: , LogError() ( ) vfwprintf_s(), . " ", , (, , ).
/?
!