# HG changeset patch # User Matti Hamalainen # Date 1352653701 -7200 # Node ID e30fa8592a48a36845297d2dedb2f3097719be02 # Parent 96d636c379769b47888e7588be608b46923c4f0b Possibly fix logging after latest changes. diff -r 96d636c37976 -r e30fa8592a48 main.c --- a/main.c Sun Nov 11 19:05:05 2012 +0200 +++ b/main.c Sun Nov 11 19:08:21 2012 +0200 @@ -76,7 +76,8 @@ { LOG_FILE = 1, LOG_WINDOW = 2, - LOG_STAMP = 4 + LOG_STAMP = 4, + LOG_FILE2 = 8 }; @@ -253,11 +254,12 @@ if (flags & LOG_FILE) { - nn_window_t *mwin = nnwin_main_window(); - if (win != mwin) - printMsgFile(win, flags, tmpStr, buf); + printMsgFile(win != NULL ? win : nnwin_main_window(), flags, tmpStr, buf); + } - printMsgFile(mwin, flags, tmpStr, buf); + if (flags & LOG_FILE2) + { + printMsgFile(nnwin_main_window(), flags, tmpStr, buf); } if (!optDaemon && (flags & LOG_WINDOW)) @@ -335,7 +337,7 @@ va_list ap; va_start(ap, fmt); - printMsgV(NULL, LOG_FILE|LOG_WINDOW, fmt, ap); + printMsgV(NULL, LOG_FILE | LOG_WINDOW, fmt, ap); va_end(ap); } } @@ -446,11 +448,11 @@ if (win != NULL) { - printMsgF(win, isIgnored ? 0 : LOG_WINDOW, + printMsgF(win, isIgnored ? LOG_FILE : (LOG_FILE | LOG_WINDOW), "½5½<½%d½%s½5½>½0½ %s\n", isMine ? 14 : 15, isMine ? optUserName : in_name, in_msg); - printMsgF(NULL, LOG_FILE, "½11½%s½0½\n", h); + printMsgF(NULL, LOG_FILE2, "½11½%s½0½\n", h); } else {