- Timestamp:
- Aug 5, 2017, 11:21:53 PM (8 years ago)
- Branches:
- master
- Children:
- 1917e53
- Parents:
- edb14cc
- git-author:
- Jason Gross <jgross@mit.edu> (12/04/16 12:40:17)
- git-committer:
- Jason Gross <jasongross9@gmail.com> (08/05/17 23:21:53)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
logging.c
redb14cc r874fd19 195 195 { 196 196 g_queue_push_tail(deferred_entry_queue, owl_log_new_entry(buffer, filename)); 197 } 198 199 static void owl_log_deferred_enqueue_first_message(const char *buffer, const char *filename) 200 { 201 g_queue_push_head(deferred_entry_queue, owl_log_new_entry(buffer, filename)); 197 202 } 198 203 … … 259 264 msg->filename, 260 265 g_strerror(ret)); 261 owl_log_deferred_enqueue_message(msg->message, msg->filename); 266 /* If we were not in deferred logging mode, either the queue should be 267 * empty, or we are attempting to log a message that we just popped off 268 * the head of the queue. Either way, we should enqueue this message as 269 * the first message in the queue, rather than the last, so that we 270 * preserve message ordering. */ 271 owl_log_deferred_enqueue_first_message(msg->message, msg->filename); 262 272 } else if (ret != 0) { 263 273 owl_log_file_error(msg, ret); … … 279 289 logged_at_least_one_message = true; 280 290 entry = (owl_log_entry*)g_queue_pop_head(deferred_entry_queue); 281 if (drop_failed_logs) { 291 if (!drop_failed_logs) { 292 /* Attempt to write the log entry. If it fails, re-queue the entry at 293 * the head of the queue. */ 282 294 owl_log_eventually_write_entry(entry); 283 295 } else { 296 /* Attempt to write the log entry. If it fails, print an error message, 297 * drop the log, and keep going through the queue. */ 284 298 ret = owl_log_try_write_entry(entry); 285 299 if (ret != 0) {
Note: See TracChangeset
for help on using the changeset viewer.