🏗️」 wip: added log debug function with VERBOSE mode

This commit is contained in:
2025-04-11 15:17:32 +02:00
parent bb841f90c8
commit b220361474
5 changed files with 46 additions and 23 deletions

View File

@ -6,7 +6,7 @@
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/03/24 15:10:07 by adjoly #+# #+# */
/* Updated: 2025/04/11 12:12:56 by adjoly ### ########.fr */
/* Updated: 2025/04/11 14:56:56 by adjoly ### ########.fr */
/* */
/* ************************************************************************** */
@ -52,12 +52,6 @@ Server::Server(std::string file_name) {
std::map<std::string, toml::ANode *> *map;
_table = tomlFile->getParsedFile();
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<std::string *>(val);
}
_log = new Logger(log_file);
try {
_table = _getServerTable();
} catch(std::runtime_error &e) {
@ -66,6 +60,13 @@ Server::Server(std::string file_name) {
delete _log;
throw e;
}
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<std::string *>(val);
std::cout << log_file << std::endl;
}
_log = new Logger(log_file);
// host and port parsing
void *host = accessValue("host", toml::STRING, _table, _log);