diff --git a/src/mu-log.c b/src/mu-log.c index 6cebf68e..c9a8dc15 100644 --- a/src/mu-log.c +++ b/src/mu-log.c @@ -1,5 +1,5 @@ /* -** Copyright (C) 2010 Dirk-Jan C. Binnema +** Copyright (C) 2008-2010 Dirk-Jan C. Binnema ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by @@ -17,7 +17,11 @@ ** */ +#ifdef HAVE_CONFIG_H #include +#endif /*HAVE_CONFIG_H*/ + +#include "mu-log.h" #include #include @@ -29,7 +33,6 @@ #include #include -#include "mu-log.h" #include "mu-util.h" #define MU_LOG_FILE "mu.log" @@ -72,9 +75,9 @@ mu_log_init_silence (void) { g_return_val_if_fail (!MU_LOG, FALSE); - MU_LOG = g_new(MuLog, 1); - MU_LOG->_fd = -1; - MU_LOG->_own = FALSE; /* nobody owns silence */ + MU_LOG = g_new(MuLog, 1); + MU_LOG->_fd = -1; + MU_LOG->_own = FALSE; /* nobody owns silence */ MU_LOG->_old_log_func = g_log_set_default_handler ((GLogFunc)silence, NULL); @@ -142,7 +145,7 @@ log_file_backup_maybe (const char *logfile) if (errno == ENOENT) return TRUE; /* it did not exist yet, no problem */ else { - g_warning ("Failed to stat(2) %s", logfile); + g_warning ("failed to stat(2) %s", logfile); return FALSE; } } @@ -168,7 +171,7 @@ mu_log_init (const char* muhome, g_return_val_if_fail (muhome, FALSE); if (!mu_util_create_dir_maybe(muhome)) { - g_warning ("Failed to init log in %s", muhome); + g_warning ("failed to init log in %s", muhome); return FALSE; } @@ -176,7 +179,7 @@ mu_log_init (const char* muhome, G_DIR_SEPARATOR, MU_LOG_FILE); if (backup && !log_file_backup_maybe(logfile)) { - g_warning ("Failed to backup log file"); + g_warning ("failed to backup log file"); return FALSE; } diff --git a/src/mu-log.h b/src/mu-log.h index 0ebef660..dcd6bd8b 100644 --- a/src/mu-log.h +++ b/src/mu-log.h @@ -1,5 +1,5 @@ /* -** Copyright (C) 2010 Dirk-Jan C. Binnema +** Copyright (C) 2008-2010 Dirk-Jan C. Binnema ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by @@ -28,7 +28,7 @@ G_BEGIN_DECLS #define MU_MAX_LOG_FILE_SIZE 1000 * 1000 /* 1 MB (SI units) */ -/** +/** * write logging information to a log file * * @param muhome the mu home directory @@ -43,7 +43,7 @@ G_BEGIN_DECLS gboolean mu_log_init (const char* muhome, gboolean backup, gboolean quiet, gboolean debug); -/** +/** * write logging information to a file descriptor * * @param fd an open file descriptor @@ -56,7 +56,7 @@ gboolean mu_log_init (const char* muhome, gboolean backup, gboolean mu_log_init_with_fd (int fd, gboolean doclose, gboolean quiet, gboolean debug); -/** +/** * be absolutely silent, except for runtime errors, which will be * written to stderr. * @@ -65,7 +65,7 @@ gboolean mu_log_init_with_fd (int fd, gboolean doclose, gboolean quiet, gboolean mu_log_init_silence (void); -/** +/** * unitialize the logging system, and free all resources */ void mu_log_uninit (void); diff --git a/src/mu-util.c b/src/mu-util.c index b4914324..95e4481e 100644 --- a/src/mu-util.c +++ b/src/mu-util.c @@ -17,6 +17,12 @@ ** */ +#ifdef HAVE_CONFIG_H +#include +#endif /*HAVE_CONFIG_H*/ + +#include "mu-util.h" + #define _XOPEN_SOURCE 500 #include /* for shell-style globbing */ #include @@ -43,8 +49,6 @@ #include #include -#include "mu-util.h" - static char* do_wordexp (const char *path) { @@ -57,12 +61,12 @@ do_wordexp (const char *path) } if (wordexp (path, &wexp, 0) != 0) { - g_debug ("%s: expansion failed for %s", __FUNCTION__, path); + /* g_debug ("%s: expansion failed for %s", __FUNCTION__, path); */ return NULL; } - if (wexp.we_wordc != 1) /* not an *error*, we just take the first one */ - g_debug ("%s: expansion ambiguous for '%s'", __FUNCTION__, path); + /* if (wexp.we_wordc != 1) /\* not an *error*, we just take the first one *\/ */ + /* g_debug ("%s: expansion ambiguous for '%s'", __FUNCTION__, path); */ dir = g_strdup (wexp.we_wordv[0]); @@ -78,6 +82,8 @@ do_wordexp (const char *path) } +/* note, the g_debugs are commented out because this function may be + * called before the log handler is installed. */ char* mu_util_dir_expand (const char *path) { @@ -92,8 +98,8 @@ mu_util_dir_expand (const char *path) /* now, resolve any symlinks, .. etc. */ if (!realpath (dir, resolved)) { - g_debug ("%s: could not get realpath for '%s': %s", - __FUNCTION__, dir, strerror(errno)); + /* g_debug ("%s: could not get realpath for '%s': %s", */ + /* __FUNCTION__, dir, strerror(errno)); */ g_free (dir); return NULL; } else