Changeset 604303c


Ignore:
Timestamp:
Aug 5, 2017, 11:21:53 PM (7 years ago)
Author:
Jason Gross <jasongross9@gmail.com>
Branches:
master
Children:
e38f315
Parents:
1917e53
git-author:
Jason Gross <jgross@mit.edu> (08/03/17 16:01:11)
git-committer:
Jason Gross <jasongross9@gmail.com> (08/05/17 23:21:53)
Message:
Give a bit more feedback when flushing logs

It's a bit hard to tell what's happening when :flush-logs gives no
feedback (though I think frequently the issue is that it just takes a
long time to write to disk).  This change displays how many logs there
are to be flushed, when the flushing fails.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • logging.c

    r1917e53 r604303c  
    282282  bool drop_failed_logs = *(bool *)data;
    283283  int ret;
    284   bool logged_at_least_one_message = false;
     284  int logged_message_count = 0;
    285285  bool all_succeeded = true;
    286286
    287287  defer_logs = false;
    288288  while (!g_queue_is_empty(deferred_entry_queue) && !defer_logs) {
    289     logged_at_least_one_message = true;
     289    logged_message_count++;
    290290    entry = (owl_log_entry*)g_queue_pop_head(deferred_entry_queue);
    291291    if (!drop_failed_logs) {
     
    304304    owl_log_entry_free(entry);
    305305  }
    306   if (all_succeeded && logged_at_least_one_message && !defer_logs) {
     306  if (all_succeeded && logged_message_count > 0 && !defer_logs) {
    307307    owl_log_adminmsg("Logs have been flushed and logging has resumed.");
     308  } else if (!all_succeeded && logged_message_count > 0 && !defer_logs) {
     309    owl_log_adminmsg("Logs have been flushed or dropped and logging has resumed.");
     310  } else if (logged_message_count > 0 && defer_logs) {
     311    owl_log_error("Attempted to flush %d logs; %u deferred logs remain.",
     312                  logged_message_count, g_queue_get_length(deferred_entry_queue));
    308313  }
    309314}
Note: See TracChangeset for help on using the changeset viewer.