mirror of
https://github.com/nicoverbruggen/phpmon.git
synced 2025-08-08 04:20:07 +02:00
✨ Added prototype binary to switch quickly
This commit is contained in:
@ -75,6 +75,8 @@ class Actions {
|
||||
brew("unlink \(formula)")
|
||||
brew("services stop \(formula)", sudo: true)
|
||||
|
||||
Log.perf("Unlinked and stopped services for \(formula)")
|
||||
|
||||
group.leave()
|
||||
}
|
||||
}
|
||||
|
@ -10,10 +10,12 @@ import Foundation
|
||||
|
||||
class Log {
|
||||
|
||||
static var shared = Log()
|
||||
|
||||
enum Verbosity: Int {
|
||||
case error = 1,
|
||||
info = 2,
|
||||
warning = 3,
|
||||
warning = 2,
|
||||
info = 3,
|
||||
performance = 4
|
||||
|
||||
public func isApplicable() -> Bool {
|
||||
@ -21,15 +23,7 @@ class Log {
|
||||
}
|
||||
}
|
||||
|
||||
static var shared = Log()
|
||||
|
||||
var verbosity: Verbosity = .info
|
||||
|
||||
static func info(_ item: Any) {
|
||||
if Verbosity.info.isApplicable() {
|
||||
print(item)
|
||||
}
|
||||
}
|
||||
var verbosity: Verbosity = .warning
|
||||
|
||||
static func err(_ item: Any) {
|
||||
if Verbosity.error.isApplicable() {
|
||||
@ -43,6 +37,12 @@ class Log {
|
||||
}
|
||||
}
|
||||
|
||||
static func info(_ item: Any) {
|
||||
if Verbosity.info.isApplicable() {
|
||||
print(item)
|
||||
}
|
||||
}
|
||||
|
||||
static func perf(_ item: Any) {
|
||||
if Verbosity.performance.isApplicable() {
|
||||
print(item)
|
||||
|
Reference in New Issue
Block a user