first commit of some basics
This commit is contained in:
35
TSE_Base/src/Debug.hpp
Normal file
35
TSE_Base/src/Debug.hpp
Normal file
@@ -0,0 +1,35 @@
|
||||
#pragma once
|
||||
|
||||
#include "LuaStateHandler.hpp"
|
||||
#include "Types.hpp"
|
||||
|
||||
#define TSE_LOG(msg) TSE::Debug::Log(msg)
|
||||
#define TSE_ERROR(msg) TSE::Debug::Error(msg)
|
||||
#define TSE_WARNING(msg) TSE::Debug::Warning(msg)
|
||||
|
||||
namespace TSE
|
||||
{
|
||||
class Debug
|
||||
{
|
||||
public:
|
||||
/// @brief initializes the log file in app data or .local, and binds lua functions
|
||||
static void Init();
|
||||
/// @brief logs soumething to the stdout, and into the log file
|
||||
/// @param msg the message to be logged
|
||||
static void Log(string msg);
|
||||
/// @brief logs soumething to the stdout, and into the log file
|
||||
/// @param msg the message to be logged
|
||||
static void Error(string msg);
|
||||
/// @brief logs soumething to the stdout, and into the log file
|
||||
/// @param msg the message to be logged
|
||||
static void Warning(string msg);
|
||||
/// @brief closes the log file
|
||||
static void Close();
|
||||
|
||||
private:
|
||||
static std::ofstream logFile;
|
||||
};
|
||||
|
||||
} // namespace TSE
|
||||
|
||||
|
||||
Reference in New Issue
Block a user