+2001-09-20 [christoph]
+
+ * src/utils.[ch]
+ more portable debug_print with source filename
+ and linenumber
+ * src/procmsg.c
+ more newlines after debug messages
+
2001-09-20 [paul]
* configure.in
setvbuf(fp, file_buf, _IOFBF, sizeof(file_buf));
g_free(cache_file);
- debug_print(_("\tReading summary cache..."));
+ debug_print(_("\tReading summary cache...\n"));
/* compare cache version */
if (fread(&ver, sizeof(ver), 1, fp) != 1 ||
g_return_if_fail(item != NULL);
g_return_if_fail(item->folder != NULL);
- debug_print(_("\tMarking the messages..."));
+ debug_print(_("\tMarking the messages...\n"));
markdir = folder_item_get_path(item);
if (!is_dir_exist(markdir))
log_verbosity_count--;
}
-void debug_print_real(const gchar *file, const guint line, const gchar *format, ...)
+void debug_print_real(const gchar *format, ...)
{
va_list args;
gchar buf[BUFFSIZE];
if (!debug_mode) return;
- printf("%s:%d:", file, line);
-
va_start(args, format);
g_vsnprintf(buf, sizeof(buf), format, args);
va_end(args);
perror(func); \
}
-#define debug_print(format, ...) debug_print_real(__FILE__, __LINE__, format , ##__VA_ARGS__)
+#define debug_print \
+ debug_print_real(__FILE__ ":%d:", __LINE__), \
+ debug_print_real
/* for macro expansion */
#define Str(x) #x
void set_log_file (const gchar *filename);
void close_log_file (void);
void log_verbosity_set (gboolean verbose);
-void debug_print_real (const gchar *file, const guint line, const gchar *format, ...) G_GNUC_PRINTF(3, 4);
+void debug_print_real (const gchar *format, ...) G_GNUC_PRINTF(1, 2);
void log_print (const gchar *format, ...) G_GNUC_PRINTF(1, 2);
void log_message (const gchar *format, ...) G_GNUC_PRINTF(1, 2);
void log_warning (const gchar *format, ...) G_GNUC_PRINTF(1, 2);