File tree 1 file changed +31
-7
lines changed
Plugins/AWSLambdaPackager
1 file changed +31
-7
lines changed Original file line number Diff line number Diff line change @@ -226,11 +226,17 @@ struct AWSLambdaPackager: CommandPlugin {
226
226
guard let _output = data. flatMap ( { String ( data: $0, encoding: . utf8) ? . trimmingCharacters ( in: CharacterSet ( [ " \n " ] ) ) } ) , !_output. isEmpty else {
227
227
return
228
228
}
229
- if logLevel >= . output {
229
+
230
+ output += _output + " \n "
231
+
232
+ switch logLevel {
233
+ case . silent:
234
+ break
235
+ case . debug( let outputIndent) , . output( let outputIndent) :
236
+ print ( String ( repeating: " " , count: outputIndent) , terminator: " " )
230
237
print ( _output)
231
238
fflush ( stdout)
232
239
}
233
- output += _output + " \n "
234
240
}
235
241
236
242
let pipe = Pipe ( )
@@ -359,13 +365,31 @@ private struct Configuration: CustomStringConvertible {
359
365
}
360
366
}
361
367
362
- private enum ProcessLogLevel : Int , Comparable {
363
- case silent = 0
364
- case output = 1
365
- case debug = 2
368
+ private enum ProcessLogLevel : Comparable {
369
+ case silent
370
+ case output( outputIndent: Int )
371
+ case debug( outputIndent: Int )
372
+
373
+ var naturalOrder : Int {
374
+ switch self {
375
+ case . silent:
376
+ return 0
377
+ case . output:
378
+ return 1
379
+ case . debug:
380
+ return 2
381
+ }
382
+ }
383
+
384
+ static var output : Self {
385
+ . output( outputIndent: 2 )
386
+ }
387
+ static var debug : Self {
388
+ . debug( outputIndent: 2 )
389
+ }
366
390
367
391
static func < ( lhs: ProcessLogLevel , rhs: ProcessLogLevel ) -> Bool {
368
- lhs. rawValue < rhs. rawValue
392
+ lhs. naturalOrder < rhs. naturalOrder
369
393
}
370
394
}
371
395
You can’t perform that action at this time.
0 commit comments