[01/18] log: Setup loglevel early

Submitted by Cyrill Gorcunov on July 19, 2018, 12:47 p.m.

Details

Message ID 20180719124746.7546-2-gorcunov@gmail.com
State Accepted
Series "x86: Add support for extendable fpu frames"
Headers show

Commit Message

Cyrill Gorcunov July 19, 2018, 12:47 p.m.
We're printing messages before the log file
is set up, so instead of keeping silence lets
print data in default outputs.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
---
 criu/crtools.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/criu/crtools.c b/criu/crtools.c
index 18be98cd7a9a..10fa435aa04b 100644
--- a/criu/crtools.c
+++ b/criu/crtools.c
@@ -702,6 +702,8 @@  int main(int argc, char *argv[], char *envp[])
 		}
 	}
 
+	log_set_loglevel(log_level);
+
 	if (early_init())
 		return -1;
 
@@ -798,7 +800,6 @@  int main(int argc, char *argv[], char *envp[])
 		return 1;
 	}
 
-	log_set_loglevel(log_level);
 
 	if (log_init(opts.output))
 		return 1;

Comments

Dmitry Safonov July 25, 2018, 7:10 p.m.
2018-07-19 13:47 GMT+01:00 Cyrill Gorcunov <gorcunov@gmail.com>:
> We're printing messages before the log file
> is set up, so instead of keeping silence lets
> print data in default outputs.
>
> Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>

Reviewed-by: Dmitry Safonov <0x7f454c46@gmail.com>

It would be better next time to mention in the commit message types
of messages being printed, e.g: early_init()=>kerndat=>compel_task_size()

Thanks,
             Dmitry