1
0
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:
Tom Lane
2004-03-22 15:34:22 +00:00
parent 682a6bd5eb
commit d81cd7032e
4 changed files with 14 additions and 15 deletions

View File

@ -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);
}