-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdebug.cpp
More file actions
48 lines (43 loc) · 1.21 KB
/
Copy pathdebug.cpp
File metadata and controls
48 lines (43 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#include "Server.hpp"
#include "debug.hpp"
#include <iomanip>
void Debug::Info(std::string const &msg)
{
if(VERBOSE)
std::cout << WHITE <<"[INFO]: " << msg << RESET << std::endl;
}
void Debug::Success(std::string const &msg)
{
std::cout << GREEN <<"[SUCCESS]: " << msg << RESET << std::endl;
}
void Debug::Warning(std::string const &msg)
{
std::cout << YELLOW <<"[WARN]: " << msg << RESET << std::endl;
}
void Debug::Error(std::string const &msg)
{
std::cerr << RED <<"[PANIC]: " << msg << RESET << std::endl;
}
void Debug::Message(std::string const &msg, int session_fd)
{
if(VERBOSE)
std::cout << CYAN <<"[FROM USER_FD=" << session_fd << "]: " << msg << RESET << std::endl;
}
void Debug::Reply(std::string const &repcode, int session_fd)
{
if(VERBOSE)
std::cout << MAGENTA <<"[TO USER_FD=" << session_fd << "]: " << repcode << RESET << std::endl;
}
void Debug::Header(void)
{
std::string header;
header = "\n\t\t\t\t\t\tMay 2024\n\
\t _ _____ _____ \n\
\t (_) __ \\ / ____|\n\
\t _| |__) | | \n\
\t | | _ /| | \n\
\t | | | \\ \\| |____ \n\
\t |_|_| \\_\\_____|\t@edfirmin\t@ggualerz\t@ndesprez\n\
\n";
std::cout <<"\033[1m" << GREEN << header << RESET << "\033[0m" << std::endl;
}