File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed
Shared/Sources/Shared/CodeCompletionService Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ public final class CodeCompletionLogger {
2626 var prompt : [ ( message: String , role: String ) ] = [ ]
2727 var responses : [ String ] = [ ]
2828 let startTime = Date ( )
29+ let id = UUID ( )
2930
3031 var shouldLogToConsole : Bool {
3132 #if DEBUG
@@ -82,7 +83,7 @@ public final class CodeCompletionLogger {
8283 let formattedDuration = String ( format: " %.2f " , duration)
8384
8485 Logger . service. info ( """
85- [Request]
86+ [Request] \( id )
8687
8788 Duration: \( formattedDuration)
8889 Error: \( error. localizedDescription) .
@@ -97,7 +98,7 @@ public final class CodeCompletionLogger {
9798 let formattedDuration = String ( format: " %.2f " , duration)
9899
99100 Logger . service. info ( """
100- [Request]
101+ [Request] \( id )
101102
102103 Format: \( model. format)
103104 Model Name: \( model. modelName)
@@ -107,12 +108,16 @@ public final class CodeCompletionLogger {
107108 File URL: \( request. fileURL)
108109 Code Snippets: \( request. relevantCodeSnippets. count) snippets
109110 CursorPosition: \( request. cursorPosition)
110-
111- [Prompt]
111+ """ )
112+
113+ Logger . service. info ( """
114+ [Prompt] \( id)
112115
113116 \( prompt. map { " \( $0. role) : \( $0. message) " } . joined ( separator: " \n \n " ) )
114-
115- [Response]
117+ """ )
118+
119+ Logger . service. info ( """
120+ [Response] \( id)
116121
117122 \( responses. enumerated ( ) . map { " \( $0 + 1 ) : \( $1) " } . joined ( separator: " \n \n " ) )
118123 """ )
You can’t perform that action at this time.
0 commit comments