mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
Standardize output buffer size and display format for strftime;
followup to complaint from Korean User's Group.
This commit is contained in:
@ -5,9 +5,8 @@
|
||||
*/
|
||||
|
||||
#include "pg_autovacuum.h"
|
||||
#define TIMEBUFF 256
|
||||
|
||||
FILE *LOGOUTPUT;
|
||||
char timebuffer[TIMEBUFF];
|
||||
char logbuffer[4096];
|
||||
|
||||
void
|
||||
@ -15,11 +14,11 @@ log_entry(const char *logentry)
|
||||
{
|
||||
time_t curtime;
|
||||
struct tm *loctime;
|
||||
char timebuffer[128];
|
||||
|
||||
curtime = time(NULL);
|
||||
loctime = localtime(&curtime);
|
||||
strftime(timebuffer, TIMEBUFF, "%Y-%m-%d %r", loctime); /* cbb - %F is not
|
||||
* always available */
|
||||
strftime(timebuffer, sizeof(timebuffer), "%Y-%m-%d %H:%M:%S %Z", loctime);
|
||||
fprintf(LOGOUTPUT, "[%s] %s\n", timebuffer, logentry);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user