@@ -60,14 +60,22 @@ type (
60
60
61
61
// DefaultLogMessageFormat is the default log message format
62
62
var DefaultLogMessageFormat = LogMessageFormat {
63
- StatusSeparator : gologgerstrings .NewRepeatedContentSeparator (gologgerstrings .SpaceSeparator ),
64
- DetailsSeparator : gologgerstrings .NewMultilineSeparator (gologgerstrings .NewLineSeparator , 1 ),
63
+ StatusSeparator : gologgerstrings .NewRepeatedContentSeparator (gologgerstrings .SpaceSeparator ),
64
+ DetailsSeparator : gologgerstrings .NewMultilineSeparator (
65
+ gologgerstrings .SpaceSeparator ,
66
+ gologgerstrings .NewLineSeparator ,
67
+ 1 ,
68
+ ),
65
69
}
66
70
67
71
// DefaultLogErrorFormat is the default log error format
68
72
var DefaultLogErrorFormat = LogErrorFormat {
69
73
StatusSeparator : gologgerstrings .NewRepeatedContentSeparator (gologgerstrings .SpaceSeparator ),
70
- ErrorsSeparator : gologgerstrings .NewMultilineSeparator (gologgerstrings .NewLineSeparator , 1 ),
74
+ ErrorsSeparator : gologgerstrings .NewMultilineSeparator (
75
+ gologgerstrings .SpaceSeparator ,
76
+ gologgerstrings .NewLineSeparator ,
77
+ 1 ,
78
+ ),
71
79
}
72
80
73
81
// DefaultLoggerFormat is the default logger format
@@ -116,7 +124,8 @@ func CopyLogErrorFormat(format *LogErrorFormat) *LogErrorFormat {
116
124
117
125
// NewLoggerFormat creates a new logger format
118
126
func NewLoggerFormat (
119
- nameSeparator * gologgerstrings.ContentSeparator , messageSeparator gologgerstrings.Separator ,
127
+ nameSeparator * gologgerstrings.ContentSeparator ,
128
+ messageSeparator gologgerstrings.Separator ,
120
129
) * LoggerFormat {
121
130
return & LoggerFormat {
122
131
NameSeparator : nameSeparator ,
@@ -144,12 +153,20 @@ func NewLogMessage(
144
153
format = & DefaultLogMessageFormat
145
154
}
146
155
147
- return & LogMessage {title : title , status : status , details : details , format : CopyLogMessageFormat (format )}
156
+ return & LogMessage {
157
+ title : title ,
158
+ status : status ,
159
+ details : details ,
160
+ format : CopyLogMessageFormat (format ),
161
+ }
148
162
}
149
163
150
164
// FormatDetails gets the formatted details
151
165
func (l * LogMessage ) FormatDetails () string {
152
- return gologgerstrings .FormatStringArray (l .format .DetailsSeparator , & l .details )
166
+ return gologgerstrings .FormatStringArray (
167
+ l .format .DetailsSeparator ,
168
+ & l .details ,
169
+ )
153
170
}
154
171
155
172
// String gets the string representation of a log message
@@ -158,7 +175,10 @@ func (l *LogMessage) String() string {
158
175
159
176
// Format status
160
177
if l .status != gologgerstatus .StatusNone {
161
- formattedLog = append (formattedLog , gologgerstrings .FormatStatus (l .status , l .format .StatusSeparator ))
178
+ formattedLog = append (
179
+ formattedLog ,
180
+ gologgerstrings .FormatStatus (l .status , l .format .StatusSeparator ),
181
+ )
162
182
}
163
183
164
184
// Add title
@@ -175,13 +195,21 @@ func (l *LogMessage) String() string {
175
195
}
176
196
177
197
// NewLogError creates a new log error
178
- func NewLogError (title string , format * LogErrorFormat , errors ... error ) * LogError {
198
+ func NewLogError (
199
+ title string ,
200
+ format * LogErrorFormat ,
201
+ errors ... error ,
202
+ ) * LogError {
179
203
// Check if the format is nil
180
204
if format == nil {
181
205
format = & DefaultLogErrorFormat
182
206
}
183
207
184
- return & LogError {title : title , errors : errors , format : CopyLogErrorFormat (format )}
208
+ return & LogError {
209
+ title : title ,
210
+ errors : errors ,
211
+ format : CopyLogErrorFormat (format ),
212
+ }
185
213
}
186
214
187
215
// FormatErrors gets the formatted errors
@@ -196,7 +224,10 @@ func (l *LogError) String() string {
196
224
// Format status
197
225
formattedLog = append (
198
226
formattedLog ,
199
- gologgerstrings .FormatStatus (gologgerstatus .StatusFailed , l .format .StatusSeparator ),
227
+ gologgerstrings .FormatStatus (
228
+ gologgerstatus .StatusFailed ,
229
+ l .format .StatusSeparator ,
230
+ ),
200
231
)
201
232
202
233
// Add message
@@ -233,7 +264,10 @@ func (d *DefaultLogger) FormatLogMessage(logMessage *LogMessage) string {
233
264
return d .formattedName
234
265
}
235
266
236
- return strings .Join ([]string {d .formattedName , logMessage .String ()}, string (d .format .MessageSeparator ))
267
+ return strings .Join (
268
+ []string {d .formattedName , logMessage .String ()},
269
+ string (d .format .MessageSeparator ),
270
+ )
237
271
}
238
272
239
273
// LogMessage logs a message
0 commit comments