forked from OSchip/llvm-project
Adjust thread name column width depending on real name length.
Make 16-byte aligned field instead of truncating a name to 16 byte. llvm-svn: 336993
This commit is contained in:
parent
57b66c8ba3
commit
0b8bea311f
|
@ -286,7 +286,11 @@ void Log::WriteHeader(llvm::raw_ostream &OS, llvm::StringRef file,
|
|||
if (options.Test(LLDB_LOG_OPTION_PREPEND_THREAD_NAME)) {
|
||||
llvm::SmallString<32> thread_name;
|
||||
llvm::get_thread_name(thread_name);
|
||||
OS << llvm::formatv("{0,-16} ", thread_name);
|
||||
|
||||
llvm::SmallString<12> format_str;
|
||||
llvm::raw_svector_ostream format_os(format_str);
|
||||
format_os << "{0,-" << llvm::alignTo<16>(thread_name.size()) << "} ";
|
||||
OS << llvm::formatv(format_str.c_str(), thread_name);
|
||||
}
|
||||
|
||||
if (options.Test(LLDB_LOG_OPTION_BACKTRACE))
|
||||
|
|
Loading…
Reference in New Issue