18
18
19
19
using namespace httplib ;
20
20
21
- auto SERVER_NAME =
22
- std::format (" cpp-httplib-nginxish-server/{}" , CPPHTTPLIB_VERSION);
21
+ auto SERVER_NAME = std::format(" cpp-httplib-server/{}" , CPPHTTPLIB_VERSION);
23
22
24
23
Server svr;
25
24
@@ -31,7 +30,7 @@ void signal_handler(int signal) {
31
30
}
32
31
}
33
32
34
- std::string get_nginx_time_format () {
33
+ std::string get_time_format () {
35
34
auto now = std::chrono::system_clock::now ();
36
35
auto time_t = std::chrono::system_clock::to_time_t (now);
37
36
@@ -40,7 +39,7 @@ std::string get_nginx_time_format() {
40
39
return ss.str ();
41
40
}
42
41
43
- std::string get_nginx_error_time_format () {
42
+ std::string get_error_time_format () {
44
43
auto now = std::chrono::system_clock::now ();
45
44
auto time_t = std::chrono::system_clock::to_time_t (now);
46
45
@@ -77,7 +76,7 @@ void nginx_access_logger(const Request &req, const Response &res) {
77
76
std::string remote_addr = get_client_ip (req);
78
77
std::string remote_user =
79
78
" -" ; // cpp-httplib doesn't have built-in auth user tracking
80
- std::string time_local = get_nginx_time_format ();
79
+ std::string time_local = get_time_format ();
81
80
std::string request =
82
81
std::format (" {} {} {}" , req.method , req.path , req.version );
83
82
int status = res.status ;
@@ -98,7 +97,7 @@ void nginx_access_logger(const Request &req, const Response &res) {
98
97
// YYYY/MM/DD HH:MM:SS [level] message, client: client_ip, request: "request",
99
98
// host: "host"
100
99
void nginx_error_logger (const Error &err, const Request *req) {
101
- std::string time_local = get_nginx_error_time_format ();
100
+ std::string time_local = get_error_time_format ();
102
101
std::string level = " error" ;
103
102
104
103
if (req) {
0 commit comments