Changeset 9f90937
- Timestamp:
- Aug 5, 2017, 10:54:33 PM (8 years ago)
- Children:
- 979dc4f
- Parents:
- 38fafd2
- git-author:
- Jason Gross <jgross@mit.edu> (01/01/14 11:23:17)
- git-committer:
- Jason Gross <jgross@mit.edu> (08/05/17 22:54:33)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
logging.c
r6d03e21 r9f90937 153 153 } 154 154 155 static void owl_log_adminmsg_main_thread(gpointer data) 156 { 157 owl_function_adminmsg("Logging", (const char*)data); 158 } 159 155 160 static void G_GNUC_PRINTF(1, 2) owl_log_error(const char *fmt, ...) 156 161 { … … 163 168 164 169 owl_select_post_task(owl_log_error_main_thread, 170 data, g_free, g_main_context_default()); 171 } 172 173 static void G_GNUC_PRINTF(1, 2) owl_log_adminmsg(const char *fmt, ...) 174 { 175 va_list ap; 176 char *data; 177 178 va_start(ap, fmt); 179 data = g_strdup_vprintf(fmt, ap); 180 va_end(ap); 181 182 owl_select_post_task(owl_log_adminmsg_main_thread, 165 183 data, g_free, g_main_context_default()); 166 184 } … … 254 272 bool drop_failed_logs = *(bool *)data; 255 273 int ret; 274 bool logged_at_least_one_message = false; 275 bool all_succeeded = true; 256 276 257 277 defer_logs = false; 258 278 while (!g_queue_is_empty(deferred_entry_queue) && !defer_logs) { 279 logged_at_least_one_message = true; 259 280 entry = (owl_log_entry*)g_queue_pop_head(deferred_entry_queue); 260 281 if (drop_failed_logs) { … … 263 284 ret = owl_log_try_write_entry(entry); 264 285 if (ret != 0) { 286 all_succeeded = false; 265 287 owl_log_file_error(entry, ret); 266 288 } 267 289 } 268 290 owl_log_entry_free(entry); 291 } 292 if (all_succeeded && logged_at_least_one_message) { 293 owl_log_adminmsg("Logs have been flushed and logging has resumed."); 269 294 } 270 295 }
Note: See TracChangeset
for help on using the changeset viewer.