aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2017-05-29 13:42:23 +0200
committerAleksander Morgado <aleksander@aleksander.es>2017-05-29 13:42:23 +0200
commit57f193bd040575642cacfd2a53de0b05d4258a6c (patch)
treef480c71aeaf99daf9151365947b9e32370c14ff8 /src
parent3bb0f7e66d8203a1dc78eb6d404e29aefef6a88c (diff)
log: remove func loc info unless MM_LOG_FUNC_LOC is defined
The user can build the project passing custom CFLAGS to enable the function location information, e.g.: $ ./configure --prefix=/usr CFLAGS="-DMM_LOG_FUNC_LOC"
Diffstat (limited to 'src')
-rw-r--r--src/main.c1
-rw-r--r--src/mm-log.c9
-rw-r--r--src/mm-log.h1
3 files changed, 3 insertions, 8 deletions
diff --git a/src/main.c b/src/main.c
index cb0e923d..c133abc9 100644
--- a/src/main.c
+++ b/src/main.c
@@ -143,7 +143,6 @@ main (int argc, char *argv[])
mm_context_get_log_file (),
mm_context_get_log_timestamps (),
mm_context_get_log_relative_timestamps (),
- mm_context_get_debug (),
&err)) {
g_warning ("Failed to set up logging: %s", err->message);
g_error_free (err);
diff --git a/src/mm-log.c b/src/mm-log.c
index da424eed..cb2b5cf2 100644
--- a/src/mm-log.c
+++ b/src/mm-log.c
@@ -47,7 +47,6 @@ static gboolean ts_flags = TS_FLAG_NONE;
static guint32 log_level = LOGL_INFO | LOGL_WARN | LOGL_ERR;
static GTimeVal rel_start = { 0, 0 };
static int logfd = -1;
-static gboolean func_loc = FALSE;
typedef struct {
guint32 num;
@@ -117,8 +116,9 @@ _mm_log (const char *loc,
g_string_append_printf (msgbuf, "[%06ld.%06ld] ", secs, usecs);
}
- if (func_loc && log_level & LOGL_DEBUG)
- g_string_append_printf (msgbuf, "[%s] %s(): ", loc, func);
+#if defined MM_LOG_FUNC_LOC
+ g_string_append_printf (msgbuf, "[%s] %s(): ", loc, func);
+#endif
va_start (args, fmt);
g_string_append_vprintf (msgbuf, fmt, args);
@@ -209,15 +209,12 @@ mm_log_setup (const char *level,
const char *log_file,
gboolean show_timestamps,
gboolean rel_timestamps,
- gboolean debug_func_loc,
GError **error)
{
/* levels */
if (level && strlen (level) && !mm_log_set_level (level, error))
return FALSE;
- func_loc = debug_func_loc;
-
if (show_timestamps)
ts_flags = TS_FLAG_WALL;
else if (rel_timestamps)
diff --git a/src/mm-log.h b/src/mm-log.h
index 762f9751..292d68a0 100644
--- a/src/mm-log.h
+++ b/src/mm-log.h
@@ -53,7 +53,6 @@ gboolean mm_log_setup (const char *level,
const char *log_file,
gboolean show_ts,
gboolean rel_ts,
- gboolean debug_func_loc,
GError **error);
void mm_log_shutdown (void);