Skip to content

Commit d6636e7

Browse files
authored
[lldb] Remove additional newline from Target logs (#6803)
Logging automatically adds a newline. Log messages with an explicit newline introduce a blank line in the logs. Additionally, use `PutCString` instead of `Printf` because these logs have no format string.
1 parent 090cf85 commit d6636e7

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lldb/source/Target/Target.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2738,18 +2738,18 @@ llvm::Optional<SwiftScratchContextReader> Target::GetSwiftScratchContext(
27382738
return nullptr;
27392739
}
27402740
if (log)
2741-
log->Printf("returned cached module-wide scratch context\n");
2741+
log->PutCString("returned cached module-wide scratch context");
27422742
return cached_ts;
27432743
}
27442744

27452745
if (!create_on_demand) {
27462746
if (log)
2747-
log->Printf("not allowed to create a new context\n");
2747+
log->PutCString("not allowed to create a new context");
27482748
return nullptr;
27492749
}
27502750
if (!GetSwiftScratchContextLock().try_lock()) {
27512751
if (log)
2752-
log->Printf("couldn't acquire scratch context lock\n");
2752+
log->PutCString("couldn't acquire scratch context lock");
27532753
return nullptr;
27542754
}
27552755

@@ -2776,14 +2776,14 @@ llvm::Optional<SwiftScratchContextReader> Target::GetSwiftScratchContext(
27762776
typesystem_sp->GetSwiftASTContext();
27772777
m_scratch_typesystem_for_module.insert({idx, typesystem_sp});
27782778
if (log)
2779-
log->Printf("created module-wide scratch context\n");
2779+
log->PutCString("created module-wide scratch context");
27802780
return typesystem_sp.get();
27812781
};
27822782

27832783
auto *swift_scratch_ctx = get_or_create_fallback_context();
27842784
if (!swift_scratch_ctx) {
27852785
if (log)
2786-
log->Printf("returned project-wide scratch context\n");
2786+
log->PutCString("returned project-wide scratch context");
27872787
auto type_system_or_err =
27882788
GetScratchTypeSystemForLanguage(eLanguageTypeSwift, create_on_demand);
27892789
if (type_system_or_err)

0 commit comments

Comments
 (0)