Skip to content

Commit f851012

Browse files
committed
Reduce logging
1 parent d8c7bb5 commit f851012

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

Sources/ShellOut.swift

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -459,13 +459,10 @@ private extension Process {
459459
let data = handler.availableData
460460

461461
if data.isEmpty { // EOF
462-
logger?.info("ShellOut.launchBash: Reporting EOF on stdout (readabilityHandler, command: \(command))")
463462
handler.readabilityHandler = nil
464463
outputGroup.leave()
465464
} else {
466-
logger?.info("ShellOut.launchBash: Read \(data.count) bytes from stdout (readabilityHandler, command: \(command))")
467465
outputQueue.async {
468-
logger?.info("ShellOut.launchBash: Reporting \(data.count) bytes from stdout (readabilityHandler, command: \(command))")
469466
outputData.append(data)
470467
outputHandle?.write(data)
471468
}
@@ -477,7 +474,6 @@ private extension Process {
477474
let data = handler.availableData
478475

479476
if data.isEmpty { // EOF
480-
logger?.info("ShellOut.launchBash: Reporting EOF on stderr (readabilityHandler, command: \(command))")
481477
handler.readabilityHandler = nil
482478
outputGroup.leave()
483479
} else {
@@ -491,18 +487,13 @@ private extension Process {
491487
try self.run()
492488
self.waitUntilExit()
493489

494-
logger?.info("ShellOut.launchBash: Waiting on EOF... (command: \(command))")
495490
if outputGroup.wait(timeout: .now() + .milliseconds(100)) == .timedOut {
496-
logger?.info("ShellOut.launchBash: Warning: Timed out waiting for EOF! (command: \(command))")
497-
} else {
498-
logger?.info("ShellOut.launchBash: EOFs received (command: \(command))")
491+
logger?.warning("ShellOut.launchBash: Timed out waiting for EOF! (command: \(command))")
499492
}
500493

501494
// We know as of this point that either all blocks have been submitted to the
502495
// queue already, or we've reached our wait timeout.
503496
return try outputQueue.sync {
504-
logger?.info("ShellOut.launchBash: Stdout: \(outputData as NSData) (command: \(command))")
505-
506497
// Do not try to readToEnd() here; if we already got an EOF, there's definitely
507498
// nothing to read, and if we timed out, trying to read here will just block
508499
// even longer.

0 commit comments

Comments
 (0)