kuasar-io / kuasar

A multi-sandbox container runtime that provides cloud-native, all-scenario multiple sandbox container solutions.
https://kuasar.io
Apache License 2.0
1.27k stars 92 forks source link

Optimize the vmm_task's log output format #37

Closed flyflypeng closed 1 year ago

flyflypeng commented 1 year ago

What should be cleaned up or changed?

Currently, vmm_task's log is redirected into the host by vmm-sandboxer process. However, vmm-sandboxer process just use the debug!() macro to print the vmm_task's logs into the stdout, which will add the redundant log header like this:

 [2023-06-27T07:24:46.160098Z DEBUG vmm_sandboxer::utils] console: [2023-06-27T07:24:45.531189Z DEBUG vmm_task::task] receive exit event: PID 87 exit with code 0                    
[2023-06-27T07:24:46.160198Z DEBUG vmm_sandboxer::utils] console: [2023-06-27T07:24:45.531308Z DEBUG vmm_task::io] copy_io: pipe stdout from to hvsock://vsock:2000                 
[2023-06-27T07:24:46.161295Z DEBUG vmm_sandboxer::utils] console: [2023-06-27T07:24:45.532399Z INFO  containerd_shim::asynchronous::task] Create request for b3fdff9ae24160e1fd21a36c6e87af6a47c4cd49a300100867aeae86390c1c63 returns pid 96               

What we want to achieve like this:

[2023-06-27T07:24:45.531189Z DEBUG vmm_task::task] receive exit event: PID 87 exit with code 0 
[2023-06-27T07:24:45.531308Z DEBUG vmm_task::io] copy_io: pipe stdout from to hvsock://vsock:2000 
[2023-06-27T07:24:45.532399Z INFO  containerd_shim::asynchronous::task] Create request for b3fdff9ae24160e1fd21a36c6e87af6a47c4cd49a300100867aeae86390c1c63 returns pid 96

Why is this needed?

Remove the redundant log header for vmm_task components log, make a more cleaner log output!

flyflypeng commented 1 year ago

This #33 issue also optimizes the kuasar log output, current issue can be optimized in the same PR