Skip to content

Commit

Permalink
bring back green hearts for debugging with logger.debug() - however, …
Browse files Browse the repository at this point in the history
…in contrast to before, DEBUG should avoid that stale lines spam the code. we can reconsider at any time if that rule does not fit in practise
  • Loading branch information
r10s committed Mar 29, 2024
1 parent d873bb5 commit d1e4cbd
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions DcCore/DcCore/DC/Logger.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,15 @@ public class DcLogger {
os_log("💙 %{public}s", log: .default, type: .default /* .default equals notice() and is persisted */, message)
}
}

// debug() marked as DEBUG as these lines are for, well debugging. and should not being released. otherwise, use info()
#if DEBUG
public func debug(_ message: String) {
if #available(iOS 14.0, *) {
(osLog as? Logger)?.debug("💚 \(message, privacy: .public)")
} else {
os_log("💚 %{public}s", log: .default, type: .debug, message)
}
}
#endif
}

0 comments on commit d1e4cbd

Please sign in to comment.