mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-02-22 11:22:26 +00:00
main: Add thread name to log output
If there is no thread then the name is reported as "anonymous". Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
parent
e8c72b1b01
commit
8a27735826
@ -73,8 +73,9 @@ impl log::Log for Logger {
|
||||
if record.file().is_some() && record.line().is_some() {
|
||||
writeln!(
|
||||
*(*(self.output.lock().unwrap())),
|
||||
"cloud-hypervisor: {:?}: {}:{}:{} -- {}",
|
||||
"cloud-hypervisor: {:?}: <{}> {}:{}:{} -- {}",
|
||||
duration,
|
||||
std::thread::current().name().unwrap_or("anonymous"),
|
||||
record.level(),
|
||||
record.file().unwrap(),
|
||||
record.line().unwrap(),
|
||||
@ -83,8 +84,9 @@ impl log::Log for Logger {
|
||||
} else {
|
||||
writeln!(
|
||||
*(*(self.output.lock().unwrap())),
|
||||
"cloud-hypervisor: {:?}: {}:{} -- {}",
|
||||
"cloud-hypervisor: {:?}: <{}> {}:{} -- {}",
|
||||
duration,
|
||||
std::thread::current().name().unwrap_or("anonymous"),
|
||||
record.level(),
|
||||
record.target(),
|
||||
record.args()
|
||||
|
Loading…
x
Reference in New Issue
Block a user