* mu/: improved logging, using the new logging functions

This commit is contained in:
djcb
2012-09-15 18:02:37 +03:00
parent fc338b5e26
commit beb1972d61
2 changed files with 64 additions and 25 deletions

View File

@ -39,6 +39,7 @@
#include "mu-runtime.h"
#include "mu-flags.h"
#include "mu-store.h"
#include "mu-log.h"
#define VIEW_TERMINATOR '\f' /* form-feed */
@ -559,6 +560,27 @@ check_params (MuConfig *opts, GError **err)
return TRUE;
}
static void
set_log_options (MuConfig *opts)
{
MuLogOptions logopts;
logopts = MU_LOG_OPTIONS_NONE;
if (opts->quiet)
logopts |= MU_LOG_OPTIONS_QUIET;
if (!opts->nocolor)
logopts |= MU_LOG_OPTIONS_COLOR;
if (opts->log_stderr)
logopts |= MU_LOG_OPTIONS_STDERR;
if (opts->debug)
logopts |= MU_LOG_OPTIONS_DEBUG;
}
MuError
mu_cmd_execute (MuConfig *opts, GError **err)
{
@ -569,6 +591,8 @@ mu_cmd_execute (MuConfig *opts, GError **err)
if (!check_params(opts, err))
return MU_G_ERROR_CODE(err);
set_log_options (opts);
switch (opts->cmd) {
/* already handled in mu-config.c */
case MU_CONFIG_CMD_HELP: return MU_OK;