Changeset db1a2f8b


Ignore:
Timestamp:
Jan 7, 2014, 6:00:45 PM (8 years ago)
Author:
Jason Gross <jgross@mit.edu>
Children:
c877a63
Parents:
7dcef03
git-author:
Jason Gross <jgross@mit.edu> (05/26/13 12:40:04)
git-committer:
Jason Gross <jgross@mit.edu> (01/07/14 18:00:45)
Message:
Display log file name on failure to open file

Also, make owl_log_error be like printf.  This will be more useful in
the next commit, when we display error codes.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • logging.c

    r7dcef03 rdb1a2f8b  
    151151}
    152152
    153 static void owl_log_error(const char *message)
    154 {
    155   char *data = g_strdup(message);
     153static void G_GNUC_PRINTF(1, 2) owl_log_error(const char *fmt, ...)
     154{
     155  va_list ap;
     156  char *data;
     157
     158  va_start(ap, fmt);
     159  data = g_strdup_vprintf(fmt, ap);
     160  va_end(ap);
     161
    156162  owl_select_post_task(owl_log_error_main_thread,
    157                        data, g_free, g_main_context_default());
     163                       data, g_free, g_main_context_default());
    158164}
    159165
     
    164170  file = fopen(msg->filename, "a");
    165171  if (!file) {
    166     owl_log_error("Unable to open file for logging");
     172    owl_log_error("Unable to open file for logging (%s)", msg->filename);
    167173    return;
    168174  }
Note: See TracChangeset for help on using the changeset viewer.