Mercurial > pidgin.yaz
comparison src/server.c @ 7431:643cbc9a6035
[gaim-migrate @ 8036]
This is good enough for CVS. This is new logging. It centers around the
highly modular "GaimLogLogger," which controls how to write the log. Currently
I only have the plain text logger. I wrote the beginning of an XML logger, but
decided I didn't think it was that great an idea. Plugins can implement loggers
themselves, so you can have, like, an SQL logger or something.
The default logger writes to a file unique to the conversation, and they're saved
on disk in a heirarchical fashion: ~/.gaim/logs/aim/seanegn/robflynn-date.log would
be a conversation I had with Rob on date.
What doesn't work:
System logging
The search button in the log viewer.
Oh, chats probably don't log either, I didn't test.
You can only log in plain text right now.
Obviously, it's not done yet. But you can play around with it, and give it
some love. I'll get back to it tomorrow after school, maybe.
committer: Tailor Script <tailor@pidgin.im>
author | Sean Egan <seanegan@gmail.com> |
---|---|
date | Wed, 05 Nov 2003 06:15:49 +0000 |
parents | ab828b8c3f22 |
children | 08ce2a94d9c7 |
comparison
equal
deleted
inserted
replaced
7430:783eea64614c | 7431:643cbc9a6035 |
---|---|
393 | 393 |
394 gaim_signal_emit(gaim_accounts_get_handle(), "account-away", | 394 gaim_signal_emit(gaim_accounts_get_handle(), "account-away", |
395 account, state, message); | 395 account, state, message); |
396 } | 396 } |
397 | 397 |
398 /* LOG system_log(log_away, gc, NULL, OPT_LOG_BUDDY_AWAY | OPT_LOG_MY_SIGNON); */ | |
398 /* New away message... Clear out the record of sent autoresponses */ | 399 /* New away message... Clear out the record of sent autoresponses */ |
399 flush_last_auto_responses(gc); | 400 flush_last_auto_responses(gc); |
400 | |
401 system_log(log_away, gc, NULL, OPT_LOG_BUDDY_AWAY | OPT_LOG_MY_SIGNON); | |
402 } | 401 } |
403 | 402 |
404 void serv_set_away_all(const char *message) | 403 void serv_set_away_all(const char *message) |
405 { | 404 { |
406 GList *c; | 405 GList *c; |
1119 gaim_blist_save(); | 1118 gaim_blist_save(); |
1120 } | 1119 } |
1121 | 1120 |
1122 if (!b->idle && idle) { | 1121 if (!b->idle && idle) { |
1123 gaim_signal_emit(gaim_blist_get_handle(), "buddy-idle", b); | 1122 gaim_signal_emit(gaim_blist_get_handle(), "buddy-idle", b); |
1124 system_log(log_idle, gc, b, OPT_LOG_BUDDY_IDLE); | |
1125 } else if (b->idle && !idle) { | 1123 } else if (b->idle && !idle) { |
1126 gaim_signal_emit(gaim_blist_get_handle(), "buddy-unidle", b); | 1124 gaim_signal_emit(gaim_blist_get_handle(), "buddy-unidle", b); |
1127 system_log(log_unidle, gc, b, OPT_LOG_BUDDY_IDLE); | |
1128 } | 1125 } |
1129 | 1126 |
1130 gaim_blist_update_buddy_idle(b, idle); | 1127 gaim_blist_update_buddy_idle(b, idle); |
1131 gaim_blist_update_buddy_evil(b, evil); | 1128 gaim_blist_update_buddy_evil(b, evil); |
1132 | 1129 /* LOG |
1133 if ((b->uc & UC_UNAVAILABLE) && !(type & UC_UNAVAILABLE)) | 1130 if ((b->uc & UC_UNAVAILABLE) && !(type & UC_UNAVAILABLE)) |
1134 system_log(log_back, gc, b, OPT_LOG_BUDDY_AWAY); | 1131 system_log(log_back, gc, b, OPT_LOG_BUDDY_AWAY); |
1135 else if (!(b->uc & UC_UNAVAILABLE) && (type & UC_UNAVAILABLE)) | 1132 else if (!(b->uc & UC_UNAVAILABLE) && (type & UC_UNAVAILABLE)) |
1136 system_log(log_away, gc, b, OPT_LOG_BUDDY_AWAY); | 1133 system_log(log_away, gc, b, OPT_LOG_BUDDY_AWAY); |
1137 | 1134 */ |
1138 gaim_blist_update_buddy_status(b, type); | 1135 gaim_blist_update_buddy_status(b, type); |
1139 | 1136 |
1140 if (loggedin) { | 1137 if (loggedin) { |
1141 if (!GAIM_BUDDY_IS_ONLINE(b)) { | 1138 if (!GAIM_BUDDY_IS_ONLINE(b)) { |
1142 if (gaim_prefs_get_bool("/core/conversations/im/show_login")) { | 1139 if (gaim_prefs_get_bool("/core/conversations/im/show_login")) { |
1159 qm->flags = GAIM_MESSAGE_SYSTEM; | 1156 qm->flags = GAIM_MESSAGE_SYSTEM; |
1160 message_queue = g_slist_append(message_queue, qm); | 1157 message_queue = g_slist_append(message_queue, qm); |
1161 } | 1158 } |
1162 } | 1159 } |
1163 gaim_sound_play_event(GAIM_SOUND_BUDDY_ARRIVE); | 1160 gaim_sound_play_event(GAIM_SOUND_BUDDY_ARRIVE); |
1164 system_log(log_signon, gc, b, OPT_LOG_BUDDY_SIGNON); | 1161 // LOG system_log(log_signon, gc, b, OPT_LOG_BUDDY_SIGNON); |
1165 } | 1162 } |
1166 } else { | 1163 } else { |
1167 if (GAIM_BUDDY_IS_ONLINE(b)) { | 1164 if (GAIM_BUDDY_IS_ONLINE(b)) { |
1168 | 1165 |
1169 if (gaim_prefs_get_bool("/core/conversations/im/show_login")) { | 1166 if (gaim_prefs_get_bool("/core/conversations/im/show_login")) { |
1185 message_queue = g_slist_append(message_queue, qm); | 1182 message_queue = g_slist_append(message_queue, qm); |
1186 } | 1183 } |
1187 } | 1184 } |
1188 serv_got_typing_stopped(gc, name); /* obviously not typing */ | 1185 serv_got_typing_stopped(gc, name); /* obviously not typing */ |
1189 gaim_sound_play_event(GAIM_SOUND_BUDDY_LEAVE); | 1186 gaim_sound_play_event(GAIM_SOUND_BUDDY_LEAVE); |
1190 system_log(log_signoff, gc, b, OPT_LOG_BUDDY_SIGNON); | 1187 // LOG system_log(log_signoff, gc, b, OPT_LOG_BUDDY_SIGNON); |
1191 } | 1188 } |
1192 } | 1189 } |
1193 | 1190 |
1194 if (c != NULL) | 1191 if (c != NULL) |
1195 gaim_conversation_update(c, GAIM_CONV_UPDATE_AWAY); | 1192 gaim_conversation_update(c, GAIM_CONV_UPDATE_AWAY); |
1360 | 1357 |
1361 gc->buddy_chats = g_slist_append(gc->buddy_chats, conv); | 1358 gc->buddy_chats = g_slist_append(gc->buddy_chats, conv); |
1362 | 1359 |
1363 gaim_conv_chat_set_id(chat, id); | 1360 gaim_conv_chat_set_id(chat, id); |
1364 | 1361 |
1365 /* TODO Move this to UI logging code! */ | 1362 /* TODO Move this to UI logging code! LOG |
1366 if (gaim_prefs_get_bool("/gaim/gtk/logging/log_chats") || | 1363 if (gaim_prefs_get_bool("/gaim/gtk/logging/log_chats") || |
1367 find_log_info(gaim_conversation_get_name(conv))) { | 1364 find_log_info(gaim_conversation_get_name(conv))) { |
1368 | 1365 |
1369 FILE *fd; | 1366 FILE *fd; |
1370 char *filename; | 1367 char *filename; |
1386 | 1383 |
1387 fclose(fd); | 1384 fclose(fd); |
1388 } | 1385 } |
1389 free(filename); | 1386 free(filename); |
1390 } | 1387 } |
1388 */ | |
1391 | 1389 |
1392 gaim_conv_window_show(gaim_conversation_get_window(conv)); | 1390 gaim_conv_window_show(gaim_conversation_get_window(conv)); |
1393 gaim_conv_window_switch_conversation(gaim_conversation_get_window(conv), | 1391 gaim_conv_window_switch_conversation(gaim_conversation_get_window(conv), |
1394 gaim_conversation_get_index(conv)); | 1392 gaim_conversation_get_index(conv)); |
1395 | 1393 |