commit - 75dce1ffacfea704c2d8568b9cdf874827d72ff9
commit + 4613bf1c4fa827736cdd51b4b653be8381c7d9d7
blob - 15ab6a18586dacba22d08d61f062ca0c066aa595
blob + b31bdb54934d0291bfc573eb0c4c321bb17e3d91
--- vostok/vostok.cc
+++ vostok/vostok.cc
#include <vector>
#include <thread>
+#include <time.h>
+#include <ctime>
+
namespace vostok
{
namespace
return true;
}
+
+void put_time_prefix()
+{
+ const std::time_t t{std::time(nullptr)};
+ struct tm converted{};
+ gmtime_r(&t, &converted);
+ error::g_log << converted.tm_hour << ":" << converted.tm_min << ":" << converted.tm_sec << " ";
+}
void client_thread(const transport::AcceptedClient *accepted_client, int directory_fd, const Mime &mime)
if (readed < buffer.size())
break;
}
+
+ put_time_prefix();
error::g_log << "20 " << meta_string << " \"" << path << "\"" << std::endl;
}
};
if (accepted_client->is_accepted())
{
+ put_time_prefix();
try
{
std::thread{client_thread, accepted_client.get(), directory_fd, mime}.detach();