mirror of
https://github.com/3lswear/webserv.git
synced 2025-10-28 21:07:59 +03:00
fix debug time
This commit is contained in:
@@ -22,17 +22,14 @@ std::string getDebugTime(void)
|
|||||||
{
|
{
|
||||||
time_t rawtime;
|
time_t rawtime;
|
||||||
struct tm *timeinfo;
|
struct tm *timeinfo;
|
||||||
|
char buf[32];
|
||||||
|
|
||||||
time(&rawtime);
|
time(&rawtime);
|
||||||
timeinfo = localtime(&rawtime);
|
timeinfo = localtime(&rawtime);
|
||||||
|
|
||||||
std::string ret = std::string(asctime(timeinfo));
|
int tmp = strftime(buf, 32, "%T", timeinfo);
|
||||||
for (size_t i = 0; i < 3; i++)
|
buf[tmp] = '\0';
|
||||||
{
|
std::string ret = std::string(buf);
|
||||||
ret.erase(0, ret.find(" ") + 1);
|
|
||||||
}
|
|
||||||
ret.erase(ret.find(" "));
|
|
||||||
|
|
||||||
ret = std::string(WARNING) + "[ " + ret + " ] "
|
ret = std::string(WARNING) + "[ " + ret + " ] "
|
||||||
+ std::string(RESET)
|
+ std::string(RESET)
|
||||||
+ std::string(OKCYAN);
|
+ std::string(OKCYAN);
|
||||||
|
|||||||
Reference in New Issue
Block a user