Changeset efaf2a6


Ignore:
Timestamp:
Feb 12, 2014, 2:57:42 PM (7 years ago)
Author:
Jason Gross <jgross@mit.edu>
Children:
66dc2c6
Parents:
9ae6095
git-author:
Jason Gross <jgross@mit.edu> (05/26/13 12:40:04)
git-committer:
Jason Gross <jgross@mit.edu> (02/12/14 14:57:42)
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 refaf2a6  
    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.