Skip to content

Instantly share code, notes, and snippets.

View kpacholak's full-sized avatar

Krzysztof Pacholak kpacholak

View GitHub Profile
@kpacholak
kpacholak / CustomPrint.swift
Created November 2, 2021 20:58
Swift print function only in DEBUG mode
import Foundation
// Global print & debugPrint function to print logs only in debug mode
// https://medium.com/macoclock/swift-print-only-in-debug-mode-c571d6173dfa
func print(_ object: Any...) {
#if DEBUG
for item in object {
Swift.print(item)
}
@kpacholak
kpacholak / customNSLog.m
Last active November 2, 2021 19:18
NSLog condition - show logs only in DEBUG mode
// https://stackoverflow.com/questions/6552197/enable-and-disable-nslog-in-debug-mode
// http://www.cimgf.com/2009/01/24/dropping-nslog-in-release-builds/
#ifdef DEBUG
#define NSLog(...) NSLog(__VA_ARGS__)
#else
#define NSLog(...)
#endif