Add TENLog and TENScriptException.

This commit is contained in:
hispidence 2021-08-03 15:08:43 +01:00
parent 49833a7fab
commit efc91a8e34
2 changed files with 51 additions and 0 deletions

View 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;
}
}