return 1;
}
+/*
+ * Print a timestamp and a message to stdout or to syslog.
+ */
+int
+tprintf1(const char *fmt, ... )
+{
+ va_list ap;
+ char line[ELOG_MAXLEN+TIMESTAMP_SIZE+1];
+
+ va_start(ap, fmt);
+#ifdef ELOG_TIMESTAMPS
+ strcpy(line, tprintf_timestamp());
+#endif
+ vsprintf(line+TIMESTAMP_SIZE, fmt, ap);
+ va_end(ap);
+
+#ifdef USE_SYSLOG
+ write_syslog(LOG_INFO, line+TIMESTAMP_SIZE);
+#endif
+
+ if (UseSyslog <= 1) {
+ puts(line);
+ fflush(stdout);
+ }
+
+ return 1;
+}
+
/*
* Print a timestamp and a message to stderr.
*/
#define TIMESTAMP_SIZE 0
#endif
+extern int tprintf1(const char *fmt, ...);
extern int tprintf(int flag, const char *fmt,...);
extern int eprintf(const char *fmt,...);
extern int option_flag(int flag);
extern int pg_options[NUM_PG_OPTIONS];
-#define PRINTF(args...) tprintf(TRACE_ALL, args)
-#define EPRINTF(args...) eprintf(args)
+#ifdef __GNUC__
+#define PRINTF(args...) tprintf1(args)
+#define EPRINTF(args...) eprintf(args)
#define TPRINTF(flag, args...) tprintf(flag, args)
+#else
+#define PRINTF tprintf1
+#define EPRINTF eprintf
+#define TPRINTF tprintf
+#endif
#endif /* TRACE_H */