1
0
mirror of https://github.com/nicoverbruggen/phpmon.git synced 2025-11-07 21:20:07 +01:00

Add additional verbosity option (#169)

This commit is contained in:
2022-05-07 13:32:45 +02:00
parent 1c15a4e07f
commit c171df0a93
4 changed files with 29 additions and 3 deletions

View File

@@ -91,7 +91,7 @@ public class Shell {
task.launch()
task.waitUntilExit()
return Shell.Output(
let output = Shell.Output(
standardOutput: String(
data: outputPipe.fileHandleForReading.readDataToEndOfFile(),
encoding: .utf8
@@ -102,6 +102,22 @@ public class Shell {
)!,
task: task
)
if CommandLine.arguments.contains("--v") {
Log.info("")
Log.info("==== COMMAND ====")
Log.info("")
Log.info("\(self.shell) \(task.arguments?.joined(separator: " ") ?? "")")
Log.info("")
Log.info("==== OUTPUT ====")
Log.info("")
dump(output)
Log.info("")
Log.info("==== END OUTPUT ====")
Log.info("")
}
return output
}
/**

View File

@@ -67,6 +67,10 @@ class AppDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCenterDele
#if DEBUG
logger.verbosity = .performance
#endif
if CommandLine.arguments.contains("--v") {
logger.verbosity = .performance
Log.info("Extra verbose mode has been activated.")
}
Log.separator(as: .info)
Log.info("PHP MONITOR by Nico Verbruggen")
Log.info("Version \(App.version)")