diff --git a/sample.toml b/sample.toml new file mode 100644 index 0000000..06c8565 --- /dev/null +++ b/sample.toml @@ -0,0 +1,9 @@ +[server] +host = "0.0.0.0" +port = 80 + +[server.location./] +methods = { "GET" } +root = "/var/www/html" +dirlist = true +client_max_body_size = "10M" diff --git a/src/help.cpp b/src/help.cpp index 34ade0f..dda3572 100644 --- a/src/help.cpp +++ b/src/help.cpp @@ -6,7 +6,7 @@ /* By: adjoly +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2025/04/10 13:08:36 by adjoly #+# #+# */ -/* Updated: 2025/05/06 16:19:36 by adjoly ### ########.fr */ +/* Updated: 2025/05/06 19:19:43 by adjoly ### ########.fr */ /* */ /* ************************************************************************** */ @@ -18,6 +18,8 @@ #include #include +using namespace webserv; + void _printHelp(void) { std::cout << "-------------- WEBSERV --------------" << std::endl; std::cout << "- --help : Print this message" << std::endl; @@ -50,7 +52,10 @@ void _generateConf(void) { } void _printVersion(void) { - std::cout << "You are running : Webserv " << WEBSRV_VERSION << std::endl; + Logger log; + std::stringstream str; + str << "you are running webserv " << WEBSRV_VERSION; + log.info(str.str()); } bool help(int ac, char **av) { diff --git a/src/main.cpp b/src/main.cpp index 5601c77..c41f83f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -6,7 +6,7 @@ /* By: mmoussou info("Starting server..."); + log.info("Starting server..."); if (access(av[1], F_OK) < 0) { std::stringstream str; str << "File : " << av[1] << " could not be opened"; - _log->error(str.str()); + log.error(str.str()); return EXIT_FAILURE; } - delete _log; + _log = not_nullptr; config::Config *conf; try { std::string str = av[1];