Using new log constructor

This commit is contained in:
matthias@arch 2022-10-14 23:39:54 +02:00
parent 1a1db94137
commit 5767428fd3
4 changed files with 26 additions and 6 deletions

View File

@ -9,7 +9,14 @@
namespace gz::vk {
int mainLoop() {
Log log("", true, false, "Main", Color::BG_RED);
LogCreateInfo logCI{};
logCI.logfile = "main.log";
logCI.storeLog = false;
logCI.prefix = "Main";
logCI.prefixColor = Color::BG_RED;
logCI.timeColor = VULKAN_MESSAGE_TIME_COLOR;
Log log(std::move(logCI));
gz::SettingsManagerCreateInfo<SettingsTypes> smCI{};
smCI.filepath = gz::vk::CONFIG_FILE;
smCI.readFileOnCreation = true;

View File

@ -16,9 +16,16 @@ namespace gz::vk {
// INIT & CLEANUP
//
Renderer2D::Renderer2D(VulkanInstance& instance, TextureManager& textureManager) :
Renderer(instance, textureManager),
rLog("renderer2D.log", true, false, "2D-Renderer", Color::LI_MAGENTA, VULKAN_MESSAGE_TIME_COLOR, true, 100)
Renderer(instance, textureManager)
{
LogCreateInfo logCI{};
logCI.logfile = "renderer2D.log";
logCI.storeLog = false;
logCI.prefix = "2D-Renderer";
logCI.prefixColor = Color::LI_MAGENTA;
logCI.timeColor = VULKAN_MESSAGE_TIME_COLOR;
rLog = Log(std::move(logCI));
vk.registerCleanupCallback(std::bind(&Renderer2D::cleanup, this));
vk.registerSwapChainRecreateCallback(std::bind(&Renderer2D::swapChainRecreateCallback, this));
vk.createCommandBuffers(commandBuffers);

View File

@ -12,8 +12,14 @@ namespace gz::vk {
// INIT & CLEANUP
//
Renderer3D::Renderer3D(VulkanInstance& instance, TextureManager& textureManager) :
Renderer(instance, textureManager),
rLog("renderer3D.log", true, false, "3D-Renderer", Color::CYAN, VULKAN_MESSAGE_TIME_COLOR, true, 100) {
Renderer(instance, textureManager) {
LogCreateInfo logCI{};
logCI.logfile = "renderer3D.log";
logCI.storeLog = false;
logCI.prefix = "3D-Renderer";
logCI.prefixColor = Color::LI_CYAN;
logCI.timeColor = VULKAN_MESSAGE_TIME_COLOR;
rLog = Log(std::move(logCI));
vk.registerCleanupCallback(std::bind(&Renderer3D::cleanup, this));
vk.registerSwapChainRecreateCallback(std::bind(&Renderer3D::swapChainRecreateCallback, this));

View File

@ -285,7 +285,7 @@ void VulkanInstance::getHandleOwnerString(std::string_view message) {
}
}
gz::Log VulkanInstance::vLog("vulkan.log", true, true, "Vulkan", VULKAN_MESSAGE_PREFIX_COLOR, VULKAN_MESSAGE_TIME_COLOR);
gz::Log VulkanInstance::vLog("vulkan.log", true, true, "Vulkan", VULKAN_MESSAGE_PREFIX_COLOR, true, VULKAN_MESSAGE_TIME_COLOR);
VKAPI_ATTR VkBool32 VKAPI_CALL VulkanInstance::debugLog(
VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverety,
VkDebugUtilsMessageTypeFlagsEXT messageType,