Unify inspector and console panel actions
This commit is contained in:
27
editor/src/Core/EditorLoggingSetup.h
Normal file
27
editor/src/Core/EditorLoggingSetup.h
Normal file
@@ -0,0 +1,27 @@
|
||||
#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
|
||||
Reference in New Issue
Block a user