Skip to content

Instantly share code, notes, and snippets.

View michael-r-may's full-sized avatar

Michael michael-r-may

View GitHub Profile
@michael-r-may
michael-r-may / loggingPrint.swift
Created December 10, 2015 22:25 — forked from Abizern/loggingPrint.swift
Debug logging for Swift
//
// LoggingPrint.swift
//
import Foundation
/**
Prints the filename, function name, line number and textual representation of `object` and a newline character into
the standard output if the build setting for "Other Swift Flags" defines `-D DEBUG`.
///
// Tracks down calls to UIKit from a Thread other than Main
// This installs a small guard that checks for the most common threading-errors in UIKit.
// This won't really slow down performance but still only is compiled in DEBUG versions of PSPDFKit.
// @note No private API is used here.
///
// You should only use this in debug builds. It doesn't use private API, but I wouldn't ship it.
#ifdef DEBUG