Skip to content

Commit

Permalink
fix(debug): show debug logs in debug config only
Browse files Browse the repository at this point in the history
  • Loading branch information
Mickaël Floc’hlay committed Feb 1, 2020
1 parent 18cc4ff commit f45f52a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Sources/Pomodoro/TimerViewCLI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -83,16 +83,18 @@ public class TimerViewCLI {
}

private func hookCompletionHandler(result: Result<Void, HookError>) {
switch result {
case .success:
debugPrint("✌️ Hook completed successfully.")
case let .failure(error):
if case let .failure(error) = result {
switch error {
case .noExecutableFileAtPath:
output.write(string: "\n💡 Did you know you can configure hooks for pomodoros? Check the README.\n")
default:
output.write(string: "\n☹️ The pomodoro hook failed executing.\n")
}
}
#if DEBUG
if case .success = result {
debugPrint("✌️ Hook completed successfully.")
}
#endif
}
}

0 comments on commit f45f52a

Please sign in to comment.