Mercurial > hg > nnchat
comparison main.c @ 544:e30fa8592a48
Possibly fix logging after latest changes.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sun, 11 Nov 2012 19:08:21 +0200 |
parents | d8184a3c241f |
children | 895ede06ff11 |
comparison
equal
deleted
inserted
replaced
543:96d636c37976 | 544:e30fa8592a48 |
---|---|
74 */ | 74 */ |
75 enum | 75 enum |
76 { | 76 { |
77 LOG_FILE = 1, | 77 LOG_FILE = 1, |
78 LOG_WINDOW = 2, | 78 LOG_WINDOW = 2, |
79 LOG_STAMP = 4 | 79 LOG_STAMP = 4, |
80 LOG_FILE2 = 8 | |
80 }; | 81 }; |
81 | 82 |
82 | 83 |
83 /* Arguments | 84 /* Arguments |
84 */ | 85 */ |
251 | 252 |
252 buf = th_strdup_vprintf(fmt, ap); | 253 buf = th_strdup_vprintf(fmt, ap); |
253 | 254 |
254 if (flags & LOG_FILE) | 255 if (flags & LOG_FILE) |
255 { | 256 { |
256 nn_window_t *mwin = nnwin_main_window(); | 257 printMsgFile(win != NULL ? win : nnwin_main_window(), flags, tmpStr, buf); |
257 if (win != mwin) | 258 } |
258 printMsgFile(win, flags, tmpStr, buf); | 259 |
259 | 260 if (flags & LOG_FILE2) |
260 printMsgFile(mwin, flags, tmpStr, buf); | 261 { |
262 printMsgFile(nnwin_main_window(), flags, tmpStr, buf); | |
261 } | 263 } |
262 | 264 |
263 if (!optDaemon && (flags & LOG_WINDOW)) | 265 if (!optDaemon && (flags & LOG_WINDOW)) |
264 { | 266 { |
265 nn_window_t *tmp = (win != NULL) ? win : nnwin_main_window(); | 267 nn_window_t *tmp = (win != NULL) ? win : nnwin_main_window(); |
333 if (optDebug) | 335 if (optDebug) |
334 { | 336 { |
335 va_list ap; | 337 va_list ap; |
336 | 338 |
337 va_start(ap, fmt); | 339 va_start(ap, fmt); |
338 printMsgV(NULL, LOG_FILE|LOG_WINDOW, fmt, ap); | 340 printMsgV(NULL, LOG_FILE | LOG_WINDOW, fmt, ap); |
339 va_end(ap); | 341 va_end(ap); |
340 } | 342 } |
341 } | 343 } |
342 | 344 |
343 | 345 |
444 isIgnored = setIgnoreMode && checkNameList(setIgnoreList, in_name); | 446 isIgnored = setIgnoreMode && checkNameList(setIgnoreList, in_name); |
445 win = nnwin_find(in_name); | 447 win = nnwin_find(in_name); |
446 | 448 |
447 if (win != NULL) | 449 if (win != NULL) |
448 { | 450 { |
449 printMsgF(win, isIgnored ? 0 : LOG_WINDOW, | 451 printMsgF(win, isIgnored ? LOG_FILE : (LOG_FILE | LOG_WINDOW), |
450 "½5½<½%d½%s½5½>½0½ %s\n", | 452 "½5½<½%d½%s½5½>½0½ %s\n", |
451 isMine ? 14 : 15, isMine ? optUserName : in_name, in_msg); | 453 isMine ? 14 : 15, isMine ? optUserName : in_name, in_msg); |
452 | 454 |
453 printMsgF(NULL, LOG_FILE, "½11½%s½0½\n", h); | 455 printMsgF(NULL, LOG_FILE2, "½11½%s½0½\n", h); |
454 } | 456 } |
455 else | 457 else |
456 { | 458 { |
457 printMsgF(NULL, isIgnored ? LOG_FILE : (LOG_WINDOW | LOG_FILE), | 459 printMsgF(NULL, isIgnored ? LOG_FILE : (LOG_WINDOW | LOG_FILE), |
458 "½11½%s½0½\n", h); | 460 "½11½%s½0½\n", h); |