Skip to content

Commit b1c1fa2

Browse files
committed
Code cleanup
1 parent fbee136 commit b1c1fa2

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

docker/main.cc

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818

1919
using namespace httplib;
2020

21-
auto SERVER_NAME =
22-
std::format("cpp-httplib-nginxish-server/{}", CPPHTTPLIB_VERSION);
21+
auto SERVER_NAME = std::format("cpp-httplib-server/{}", CPPHTTPLIB_VERSION);
2322

2423
Server svr;
2524

@@ -31,7 +30,7 @@ void signal_handler(int signal) {
3130
}
3231
}
3332

34-
std::string get_nginx_time_format() {
33+
std::string get_time_format() {
3534
auto now = std::chrono::system_clock::now();
3635
auto time_t = std::chrono::system_clock::to_time_t(now);
3736

@@ -40,7 +39,7 @@ std::string get_nginx_time_format() {
4039
return ss.str();
4140
}
4241

43-
std::string get_nginx_error_time_format() {
42+
std::string get_error_time_format() {
4443
auto now = std::chrono::system_clock::now();
4544
auto time_t = std::chrono::system_clock::to_time_t(now);
4645

@@ -77,7 +76,7 @@ void nginx_access_logger(const Request &req, const Response &res) {
7776
std::string remote_addr = get_client_ip(req);
7877
std::string remote_user =
7978
"-"; // 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();
8180
std::string request =
8281
std::format("{} {} {}", req.method, req.path, req.version);
8382
int status = res.status;
@@ -98,7 +97,7 @@ void nginx_access_logger(const Request &req, const Response &res) {
9897
// YYYY/MM/DD HH:MM:SS [level] message, client: client_ip, request: "request",
9998
// host: "host"
10099
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();
102101
std::string level = "error";
103102

104103
if (req) {

0 commit comments

Comments
 (0)