mirror of
https://github.com/TombEngine/TombEngine.git
synced 2025-05-12 21:47:03 +03:00
Add TENLog and TENScriptException.
This commit is contained in:
parent
49833a7fab
commit
efc91a8e34
2 changed files with 51 additions and 0 deletions
29
TR5Main/Game/debug/debug.cpp
Normal file
29
TR5Main/Game/debug/debug.cpp
Normal file
|
@ -0,0 +1,29 @@
|
|||
#include "framework.h"
|
||||
#include <iostream>
|
||||
|
||||
void TENLog(std::string_view str, LogLevel level, LogConfig config)
|
||||
{
|
||||
if constexpr (DebugBuild)
|
||||
{
|
||||
if (LogConfig::Debug == config)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
switch (level)
|
||||
{
|
||||
case LogLevel::Error:
|
||||
std::cerr << "Error: " << str << "\n";
|
||||
// Monty code goes here
|
||||
break;
|
||||
case LogLevel::Warning:
|
||||
std::cout << "Warning: " << str << "\n";
|
||||
// Monty code goes here
|
||||
break;
|
||||
case LogLevel::Info:
|
||||
std::cout << "Info: " << str << "\n";
|
||||
// Monty code goes here
|
||||
break;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue