File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -171,18 +171,18 @@ public struct JSONLogger : LogHandler {
171171 #"}"#
172172 ) . utf8)
173173 }
174- let dataNoSeparator = prefix + jsonLine + suffix
174+ let lineDataNoSeparator = prefix + jsonLine + suffix
175175
176176 /* We lock, because the writeAll function might split the write in more than 1 write
177177 * (if the write system call only writes a part of the data).
178178 * If another part of the program writes to fd, we might get interleaved data,
179179 * because they cannot be aware of our lock (and we cannot be aware of theirs if they have one). */
180180 JSONLogger . lock. withLock {
181- let prefix : Data
182- if Self . isFirstLog { prefix = Data ( ) ; Self . isFirstLog = false }
183- else { prefix = lineSeparator}
181+ let interLogData : Data
182+ if Self . isFirstLog { interLogData = Data ( ) ; Self . isFirstLog = false }
183+ else { interLogData = lineSeparator}
184184 /* Is there a better idea than silently drop the message in case of fail? */
185- _ = try ? outputFileDescriptor. writeAll ( prefix + dataNoSeparator )
185+ _ = try ? outputFileDescriptor. writeAll ( interLogData + lineDataNoSeparator )
186186 }
187187 }
188188
You can’t perform that action at this time.
0 commit comments