Deleted
Added
nxt_app_log.c (564:762f8c976ead) | nxt_app_log.c (703:2d536dde84d2) |
---|---|
1 2/* 3 * Copyright (C) Igor Sysoev 4 * Copyright (C) NGINX, Inc. 5 */ 6 7#include <nxt_main.h> 8#include <nxt_runtime.h> --- 81 unchanged lines hidden (view full) --- 90 } 91} 92 93 94static nxt_time_string_t nxt_log_error_time_cache = { 95 (nxt_atomic_uint_t) -1, 96 nxt_log_error_time, 97 "%4d/%02d/%02d %02d:%02d:%02d ", | 1 2/* 3 * Copyright (C) Igor Sysoev 4 * Copyright (C) NGINX, Inc. 5 */ 6 7#include <nxt_main.h> 8#include <nxt_runtime.h> --- 81 unchanged lines hidden (view full) --- 90 } 91} 92 93 94static nxt_time_string_t nxt_log_error_time_cache = { 95 (nxt_atomic_uint_t) -1, 96 nxt_log_error_time, 97 "%4d/%02d/%02d %02d:%02d:%02d ", |
98 sizeof("1970/09/28 12:00:00 ") - 1, | 98 nxt_length("1970/09/28 12:00:00 "), |
99 NXT_THREAD_TIME_LOCAL, 100 NXT_THREAD_TIME_MSEC, 101}; 102 103 104static u_char * 105nxt_log_error_time(u_char *buf, nxt_realtime_t *now, struct tm *tm, size_t size, 106 const char *format) 107{ 108 return nxt_sprintf(buf, buf + size, format, 109 tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, 110 tm->tm_hour, tm->tm_min, tm->tm_sec); 111} 112 113 114static nxt_time_string_t nxt_log_debug_time_cache = { 115 (nxt_atomic_uint_t) -1, 116 nxt_log_debug_time, 117 "%4d/%02d/%02d %02d:%02d:%02d.%03d ", | 99 NXT_THREAD_TIME_LOCAL, 100 NXT_THREAD_TIME_MSEC, 101}; 102 103 104static u_char * 105nxt_log_error_time(u_char *buf, nxt_realtime_t *now, struct tm *tm, size_t size, 106 const char *format) 107{ 108 return nxt_sprintf(buf, buf + size, format, 109 tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, 110 tm->tm_hour, tm->tm_min, tm->tm_sec); 111} 112 113 114static nxt_time_string_t nxt_log_debug_time_cache = { 115 (nxt_atomic_uint_t) -1, 116 nxt_log_debug_time, 117 "%4d/%02d/%02d %02d:%02d:%02d.%03d ", |
118 sizeof("1970/09/28 12:00:00.000 ") - 1, | 118 nxt_length("1970/09/28 12:00:00.000 "), |
119 NXT_THREAD_TIME_LOCAL, 120 NXT_THREAD_TIME_MSEC, 121}; 122 123 124static u_char * 125nxt_log_debug_time(u_char *buf, nxt_realtime_t *now, struct tm *tm, size_t size, 126 const char *format) 127{ 128 return nxt_sprintf(buf, buf + size, format, 129 tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, 130 tm->tm_hour, tm->tm_min, tm->tm_sec, 131 now->nsec / 1000000); 132} | 119 NXT_THREAD_TIME_LOCAL, 120 NXT_THREAD_TIME_MSEC, 121}; 122 123 124static u_char * 125nxt_log_debug_time(u_char *buf, nxt_realtime_t *now, struct tm *tm, size_t size, 126 const char *format) 127{ 128 return nxt_sprintf(buf, buf + size, format, 129 tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, 130 tm->tm_hour, tm->tm_min, tm->tm_sec, 131 now->nsec / 1000000); 132} |