28 lines
850 B
C
28 lines
850 B
C
|
|
#pragma once
|
||
|
|
|
||
|
|
#include "Core/EditorConsoleSink.h"
|
||
|
|
|
||
|
|
#include <XCEngine/Debug/ConsoleLogSink.h>
|
||
|
|
#include <XCEngine/Debug/FileLogSink.h>
|
||
|
|
#include <XCEngine/Debug/Logger.h>
|
||
|
|
|
||
|
|
#include <memory>
|
||
|
|
#include <string>
|
||
|
|
|
||
|
|
namespace XCEngine {
|
||
|
|
namespace Editor {
|
||
|
|
|
||
|
|
inline void ConfigureEditorLogging(const std::string& executableDirectory) {
|
||
|
|
auto& logger = Debug::Logger::Get();
|
||
|
|
logger.AddSink(std::make_unique<Debug::ConsoleLogSink>());
|
||
|
|
logger.AddSink(std::make_unique<Debug::EditorConsoleSink>());
|
||
|
|
|
||
|
|
const std::string logPath = executableDirectory + "\\editor.log";
|
||
|
|
logger.AddSink(std::make_unique<Debug::FileLogSink>(logPath.c_str()));
|
||
|
|
logger.Info(Debug::LogCategory::General, "Editor Application starting...");
|
||
|
|
logger.Info(Debug::LogCategory::General, ("Log file: " + logPath).c_str());
|
||
|
|
}
|
||
|
|
|
||
|
|
} // namespace Editor
|
||
|
|
} // namespace XCEngine
|