summaryrefslogtreecommitdiffstats
path: root/api/src/glfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'api/src/glfs.c')
-rw-r--r--api/src/glfs.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/api/src/glfs.c b/api/src/glfs.c
index 9e9a55ccb65..d09c737f6d6 100644
--- a/api/src/glfs.c
+++ b/api/src/glfs.c
@@ -486,7 +486,7 @@ glfs_set_volfile_server (struct glfs *fs, const char *transport,
int
glfs_set_logging (struct glfs *fs, const char *logfile, int loglevel)
{
- int ret = 0;
+ int ret = 0;
char *tmplog = NULL;
if (!logfile) {
@@ -498,15 +498,16 @@ glfs_set_logging (struct glfs *fs, const char *logfile, int loglevel)
tmplog = (char *)logfile;
}
+ /* finish log set parameters before init */
+ if (loglevel >= 0)
+ gf_log_set_loglevel (loglevel);
+
ret = gf_log_init (fs->ctx, tmplog, NULL);
if (ret)
goto out;
- if (loglevel >= 0)
- gf_log_set_loglevel (loglevel);
-
out:
- return ret;
+ return ret;
}