mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-04 22:02:52 +01:00
Explorer: Add heading and sub-heading methods to trace (#3088)
Instead of manually putting symbols before and after heading, this introduces two methods `Heading` and `SubHeading` inside `TraceStream`. Both methods take `llvm::StringRef` as parameter, formats the given text as follows and adds it into the output stream. **Heading** ``` * * * * * * * * * * heading * * * * * * * * * * ------------------------------------------------- ``` **Sub heading** ``` - - - - - sub heading - - - - - --------------------------------- ``` Note: both methods assert that tracing should be enabled.
This commit is contained in:
@@ -78,7 +78,7 @@ auto ParseAndExecute(llvm::vfs::FileSystem& fs, std::string_view prelude_path,
|
||||
auto print_trace_timing_heading = llvm::make_scope_exit([=]() {
|
||||
SetProgramPhase set_prog_phase(*trace_stream, ProgramPhase::Timing);
|
||||
if (trace_stream->is_enabled()) {
|
||||
*trace_stream << "********** printing timing **********\n";
|
||||
trace_stream->Heading("printing timing");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user