mirror of https://github.com/djcb/mu.git
* cosmetics
This commit is contained in:
parent
2c24a43211
commit
73752ca4a9
24
src/mu-log.c
24
src/mu-log.c
|
@ -90,7 +90,6 @@ mu_log_init_silence (void)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
log_handler (const gchar* log_domain, GLogLevelFlags log_level,
|
||||
const gchar* msg)
|
||||
|
@ -112,6 +111,7 @@ mu_log_init_with_fd (int fd, gboolean doclose,
|
|||
|
||||
MU_LOG->_fd = fd;
|
||||
MU_LOG->_quiet = quiet;
|
||||
MU_LOG->_newline_before_msg = FALSE;
|
||||
MU_LOG->_debug = debug;
|
||||
MU_LOG->_own = doclose; /* if we now own the fd, close it
|
||||
* in _destroy */
|
||||
|
@ -258,14 +258,20 @@ log_write (const char* domain, GLogLevelFlags level,
|
|||
fprintf (stderr, "%s: failed to write to log: %s\n",
|
||||
__FUNCTION__, strerror(errno));
|
||||
|
||||
if (!(MU_LOG->_quiet) && (level & G_LOG_LEVEL_MESSAGE))
|
||||
g_print ("mu: %s\n", msg);
|
||||
if (!(MU_LOG->_quiet) && (level & G_LOG_LEVEL_MESSAGE)) {
|
||||
fputs ("mu: ", stdout);
|
||||
fputs (msg, stdout);
|
||||
fputs ("\n", stdout);
|
||||
fflush (stdout);
|
||||
}
|
||||
|
||||
/* for serious errors, log them to stderr as well */
|
||||
if (level & G_LOG_LEVEL_ERROR)
|
||||
g_printerr ("mu: %s\n", msg);
|
||||
else if (level & G_LOG_LEVEL_CRITICAL)
|
||||
g_printerr ("mu: %s\n", msg);
|
||||
else if (level & G_LOG_LEVEL_WARNING)
|
||||
g_printerr ("mu: %s\n", msg);
|
||||
if (level & G_LOG_LEVEL_ERROR ||
|
||||
level & G_LOG_LEVEL_CRITICAL ||
|
||||
level & G_LOG_LEVEL_WARNING) {
|
||||
fputs ("mu: ", stderr);
|
||||
fputs (msg, stderr);
|
||||
fputs ("\n", stderr);
|
||||
fflush (stderr);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -70,6 +70,7 @@ gboolean mu_log_init_silence (void) G_GNUC_WARN_UNUSED_RESULT;
|
|||
*/
|
||||
void mu_log_uninit (void);
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /*__MU_LOG_H__*/
|
||||
|
|
Loading…
Reference in New Issue