From 521bc49d48c4a3534c4762b7cc64e4ada9a1d047 Mon Sep 17 00:00:00 2001 From: adjoly Date: Fri, 11 Apr 2025 15:57:02 +0200 Subject: [PATCH] =?UTF-8?q?=E3=80=8C=F0=9F=94=A8=E3=80=8D=20fix:=20fixed?= =?UTF-8?q?=20log=20file=20writing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- includes/log.hpp | 4 ++-- src/config/Server.cpp | 5 ++--- test.toml | 0 3 files changed, 4 insertions(+), 5 deletions(-) delete mode 100644 test.toml diff --git a/includes/log.hpp b/includes/log.hpp index 489f227..c678cb3 100644 --- a/includes/log.hpp +++ b/includes/log.hpp @@ -6,7 +6,7 @@ /* By: adjoly +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2025/03/20 09:28:27 by adjoly #+# #+# */ -/* Updated: 2025/04/11 15:19:58 by adjoly ### ########.fr */ +/* Updated: 2025/04/11 15:49:38 by adjoly ### ########.fr */ /* */ /* ************************************************************************** */ @@ -42,7 +42,7 @@ class Logger { public: Logger(const std::string &fileName) : _fileName(fileName) { log("➕", "Logger", "filename constructor called"); - if (!fileName.empty()) { + if (fileName.empty()) { _ttyOnly = true; } else { _file.open(fileName.c_str(), std::ios::app); diff --git a/src/config/Server.cpp b/src/config/Server.cpp index a510406..a26bd06 100644 --- a/src/config/Server.cpp +++ b/src/config/Server.cpp @@ -6,7 +6,7 @@ /* By: adjoly +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2025/03/24 15:10:07 by adjoly #+# #+# */ -/* Updated: 2025/04/11 14:56:56 by adjoly ### ########.fr */ +/* Updated: 2025/04/11 15:44:20 by adjoly ### ########.fr */ /* */ /* ************************************************************************** */ @@ -63,8 +63,7 @@ Server::Server(std::string file_name) { void *val = _table->access("log_file", toml::STRING, found); std::string log_file = ""; if (found == true && val != not_nullptr) { - std::string log_file = *static_cast(val); - std::cout << log_file << std::endl; + log_file = *static_cast(val); } _log = new Logger(log_file); diff --git a/test.toml b/test.toml deleted file mode 100644 index e69de29..0000000