From 0ad5049785be8606833d828c201759399b4311dd Mon Sep 17 00:00:00 2001 From: Nico Verbruggen Date: Sat, 12 Feb 2022 14:52:10 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Add=20`separator`=20to=20Log?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- phpmon/Common/Core/Logger.swift | 6 ++++++ phpmon/Domain/App/AppDelegate.swift | 4 ++-- phpmon/Domain/App/Startup.swift | 4 ++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/phpmon/Common/Core/Logger.swift b/phpmon/Common/Core/Logger.swift index 8616528..776aecf 100644 --- a/phpmon/Common/Core/Logger.swift +++ b/phpmon/Common/Core/Logger.swift @@ -49,4 +49,10 @@ class Log { } } + static func separator(as verbosity: Verbosity = .info) { + if verbosity.isApplicable() { + print("==================================") + } + } + } diff --git a/phpmon/Domain/App/AppDelegate.swift b/phpmon/Domain/App/AppDelegate.swift index 7cc39d4..1b1f329 100644 --- a/phpmon/Domain/App/AppDelegate.swift +++ b/phpmon/Domain/App/AppDelegate.swift @@ -64,10 +64,10 @@ class AppDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCenterDele */ override init() { logger.verbosity = .info - Log.info("==================================") + Log.separator(as: .info) Log.info("PHP MONITOR by Nico Verbruggen") Log.info("Version \(App.version)") - Log.info("==================================") + Log.separator(as: .info) self.sharedShell = Shell.user self.state = App.shared self.menu = MainMenu.shared diff --git a/phpmon/Domain/App/Startup.swift b/phpmon/Domain/App/Startup.swift index f6657b4..1b61230 100644 --- a/phpmon/Domain/App/Startup.swift +++ b/phpmon/Domain/App/Startup.swift @@ -28,7 +28,7 @@ class Startup { continue } - // If we get here, something's gone wrong and the check has failed + // If we get here, something's gone wrong and the check has failed... Log.info("[FAIL] \(check.name)") showAlert(for: check) return false @@ -36,7 +36,7 @@ class Startup { // If we get here, nothing has gone wrong. That's what we want! initializeSwitcher() - Log.info("==================================") + Log.separator(as: .info) Log.info("PHP Monitor has determined the application has successfully passed all checks.") return true }