From 843cf9b490edee86c294d93c5df3af30dcaab934 Mon Sep 17 00:00:00 2001 From: Curve Date: Sun, 12 Nov 2023 11:17:17 +0100 Subject: [PATCH] fix: log directory creation --- CMakeLists.txt | 2 +- package.json | 2 +- src/logger.cpp | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 80a8395..addece9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.21) -project(venmic LANGUAGES CXX VERSION 2.1.1) +project(venmic LANGUAGES CXX VERSION 2.1.2) # -------------------------------------------------------------------------------------------------------- # Library options diff --git a/package.json b/package.json index e790fd3..2fa74b3 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "private": false, "license": "MIT", "author": "Curve (https://github.com/Curve)", - "version": "2.1.1", + "version": "2.1.2", "main": "./lib/index.js", "types": "./lib/module.d.ts", "scripts": { diff --git a/src/logger.cpp b/src/logger.cpp index 8192db3..768560b 100644 --- a/src/logger.cpp +++ b/src/logger.cpp @@ -48,15 +48,15 @@ namespace vencord return; } - auto log_file = log_directory() / "venmic.log"; + auto directory = log_directory(); - if (!fs::exists(log_file)) + if (!fs::exists(directory)) { [[maybe_unused]] std::error_code ec; - fs::create_directories(log_file.parent_path(), ec); + fs::create_directories(directory, ec); } - auto file_sink = std::make_shared(log_file.string()); + auto file_sink = std::make_shared((directory / "venmic.log").string()); file_sink->set_level(spdlog::level::trace); m_impl->logger->sinks().emplace_back(file_sink);