mirror of https://github.com/djcb/mu.git
* lib/mu-runtime: update for logging changes
This commit is contained in:
parent
04523b4cd1
commit
5b0d056f58
|
@ -1,6 +1,6 @@
|
||||||
/* -*- mode: c; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
|
/* -*- mode: c; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
|
||||||
**
|
**
|
||||||
** Copyright (C) 2010 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
|
** Copyright (C) 2010-2012 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
|
||||||
**
|
**
|
||||||
** This program is free software; you can redistribute it and/or modify it
|
** 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 the
|
** under the terms of the GNU General Public License as published by the
|
||||||
|
@ -53,21 +53,17 @@ static const char* runtime_path (MuRuntimePath path);
|
||||||
|
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
init_log (const char *muhome, const char *name,
|
init_log (const char *muhome, const char *name, MuLogOptions opts)
|
||||||
gboolean log_stderr, gboolean quiet, gboolean debug)
|
|
||||||
{
|
{
|
||||||
gboolean rv;
|
gboolean rv;
|
||||||
char *logpath;
|
char *logpath;
|
||||||
|
|
||||||
if (log_stderr)
|
|
||||||
return mu_log_init_with_fd (fileno(stderr), FALSE,
|
|
||||||
quiet, debug);
|
|
||||||
|
|
||||||
logpath = g_strdup_printf ("%s%c%s%c%s.log",
|
logpath = g_strdup_printf ("%s%c%s%c%s.log",
|
||||||
muhome, G_DIR_SEPARATOR,
|
muhome, G_DIR_SEPARATOR,
|
||||||
MU_LOG_DIRNAME, G_DIR_SEPARATOR,
|
MU_LOG_DIRNAME, G_DIR_SEPARATOR,
|
||||||
name);
|
name);
|
||||||
rv = mu_log_init (logpath, TRUE, quiet, debug);
|
|
||||||
|
rv = mu_log_init (logpath, opts);
|
||||||
g_free (logpath);
|
g_free (logpath);
|
||||||
|
|
||||||
return rv;
|
return rv;
|
||||||
|
@ -75,7 +71,6 @@ init_log (const char *muhome, const char *name,
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
mu_runtime_init (const char* muhome_arg, const char *name)
|
mu_runtime_init (const char* muhome_arg, const char *name)
|
||||||
{
|
{
|
||||||
|
@ -104,7 +99,7 @@ mu_runtime_init (const char* muhome_arg, const char *name)
|
||||||
init_paths (muhome, _data);
|
init_paths (muhome, _data);
|
||||||
_data->_name = g_strdup (name);
|
_data->_name = g_strdup (name);
|
||||||
|
|
||||||
if (!init_log (muhome, name, FALSE, TRUE, FALSE)) {
|
if (!init_log (muhome, name, MU_LOG_OPTIONS_BACKUP)) {
|
||||||
runtime_free ();
|
runtime_free ();
|
||||||
g_free (muhome);
|
g_free (muhome);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
#define __MU_RUNTIME_H__
|
#define __MU_RUNTIME_H__
|
||||||
|
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
|
#include <mu-log.h>
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue