Skip to content
Browse files

logging more

  • Loading branch information...
1 parent 5252227 commit 436d79d020918c0fb2be158882cecbbc147e5414 @amir amir committed Mar 4, 2009
Showing with 15 additions and 3 deletions.
  1. +15 −3 bti.c
View
18 bti.c
@@ -561,19 +561,31 @@ static void log_session(struct session *session, int retval)
break;
}
- if (session->action == ACTION_UPDATE) {
+ switch (session->action) {
+ case ACTION_UPDATE:
if (retval)
fprintf(log_file, "%s: host=%s tweet failed\n",
session->time, host);
else
fprintf(log_file, "%s: host=%s tweet=%s\n",
session->time, host, session->tweet);
- } else if (session->action == ACTION_FRIENDS) {
+ break;
+ case ACTION_FRIENDS:
fprintf(log_file, "%s: host=%s retrieving friends timeline\n",
session->time, host);
- } else if (session->action == ACTION_PUBLIC) {
+ break;
+ case ACTION_USER:
+ fprintf(log_file, "%s: host=%s retrieving %s's timeline\n",
+ session->time, host, session->user);
+ break;
+ case ACTION_REPLIES:
+ fprintf(log_file, "%s: host=%s retrieving replies\n",
+ session->time, host);
+ break;
+ case ACTION_PUBLIC:
fprintf(log_file, "%s: host=%s retrieving public timeline\n",
session->time, host);
+ break;
}
fclose(log_file);

0 comments on commit 436d79d

Please sign in to comment.
Something went wrong with that request. Please try again.