1
0
mirror of https://github.com/nicoverbruggen/phpmon.git synced 2025-08-09 04:42:59 +02:00

Added prototype binary to switch quickly

This commit is contained in:
2021-12-21 17:52:13 +01:00
parent e76c6e14e4
commit 63f4f8b078
5 changed files with 83 additions and 36 deletions

View File

@@ -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)