comparison mcabber/libjabber/jconn.c @ 374:bd5638c21834

Improve logging system (traces) There are now two trace logging levels: * tracelog_level = 1: Most messages from the log window are written to disk (LPRINT_LOG) * tracelog_level =2: LPRINT_LOG & LPRINT_DEBUG messages are written to disk The trace file name is set with the "tracelog_file" option.
author Mikael Berthe <mikael@lilotux.net>
date Mon, 25 Jul 2005 21:46:35 +0100
parents 99a99a160113
children 17aa60c6dc63
comparison
equal deleted inserted replaced
373:af2f8ddf6a1b 374:bd5638c21834
18 */ 18 */
19 19
20 #include "jabber.h" 20 #include "jabber.h"
21 #include "connwrap.h" 21 #include "connwrap.h"
22 22
23 #include "../src/utils.h" 23 #include "../src/logprint.h" /* For logging */
24 24
25 /* local macros for launching event handlers */ 25 /* local macros for launching event handlers */
26 #define STATE_EVT(arg) if(j->on_state) { (j->on_state)(j, (arg) ); } 26 #define STATE_EVT(arg) if(j->on_state) { (j->on_state)(j, (arg) ); }
27 27
28 /* prototypes of the local functions */ 28 /* prototypes of the local functions */
368 368
369 } else if(r) { 369 } else if(r) {
370 /* Don't disconnect for interrupted system call */ 370 /* Don't disconnect for interrupted system call */
371 if(errno == EINTR) return; 371 if(errno == EINTR) return;
372 372
373 ut_WriteLog("jab_poll: select returned errno=%d\n", errno); 373 scr_LogPrint(LPRINT_LOGNORM, "jab_poll: select returned errno=%d",
374 errno);
374 STATE_EVT(JCONN_STATE_OFF); 375 STATE_EVT(JCONN_STATE_OFF);
375 jab_stop(j); 376 jab_stop(j);
376 377
377 } 378 }
378 } 379 }