File tree 1 file changed +8
-4
lines changed
1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -173,7 +173,7 @@ func objectMessage(
173
173
a ... any ,
174
174
) string {
175
175
// Output object.
176
- // A general structure for outputting a logo in JSON format.
176
+ // A general structure for outputting a log in JSON format.
177
177
obj := struct {
178
178
Prefix string `json:"prefix,omitempty"`
179
179
Level string `json:"level,omitempty"`
@@ -210,7 +210,7 @@ func objectMessage(
210
210
211
211
// Function address.
212
212
if o .Layouts .FuncAddress () {
213
- obj .FuncName = fmt .Sprintf ("%#x" , sf .FuncAddress )
213
+ obj .FuncAddress = fmt .Sprintf ("%#x" , sf .FuncAddress )
214
214
}
215
215
216
216
// Line number.
@@ -237,16 +237,20 @@ func objectMessage(
237
237
238
238
// Add JSON formatting.
239
239
var msg string
240
-
241
240
switch {
242
241
case f == "" :
243
242
fallthrough
244
243
case f == formatPrint :
245
- msg = fmt . Sprintf ( "%s%s" , data , o . Space )
244
+ msg = string ( data )
246
245
default : // for formatStrLn and others
247
246
msg = fmt .Sprintf ("%s\n " , data )
248
247
}
249
248
249
+ // Add space if necessary.
250
+ if o .Space != "" {
251
+ msg += o .Space
252
+ }
253
+
250
254
return msg
251
255
}
252
256
You can’t perform that action at this time.
0 commit comments