-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🔀 Prepare info output for some commands (#19)
* ✨ Add possibility to optionally suppress `System` output * ✨ Add logger for logging output * ✨ Suppress `ArchiveService` output * ✨ Add output to `CarthageController` calls * ✨ Add output to `AutoPrefixService` * ✨ Add info output to `Download` command * ✨ Add info output to `Upload` command
- Loading branch information
Showing
7 changed files
with
142 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import Foundation | ||
import TSCUtility | ||
|
||
protocol Logging { | ||
func logStdout(_ output: String...) | ||
func info(_ info: String...) | ||
} | ||
|
||
struct Logger: Logging { | ||
static let shared = Logger() | ||
|
||
private init() { | ||
|
||
} | ||
|
||
func logStdout(_ output: String...) { | ||
print(type: "[OUTPUT]", output: output) | ||
} | ||
|
||
func info(_ info: String...) { | ||
print(type: "[INFO]", output: info) | ||
} | ||
|
||
func error(_ error: String...) { | ||
print(type: "[ERROR]", output: error) | ||
} | ||
|
||
private func print(type: String, output: [String]) { | ||
Swift.print( | ||
type, | ||
output.map { $0.trimmingCharacters(in: .newlines).replacingOccurrences(of: "\n", with: "\n" + type) } | ||
.joined(separator: " ") | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters