Skip to content

Instantly share code, notes, and snippets.

@adow
Forked from xmzio/Macros.swift
Created November 10, 2015 01:48
Show Gist options
  • Select an option

  • Save adow/d2221d38e5dc65d4efa6 to your computer and use it in GitHub Desktop.

Select an option

Save adow/d2221d38e5dc65d4efa6 to your computer and use it in GitHub Desktop.

Revisions

  1. @xmzio xmzio revised this gist Jun 14, 2014. 1 changed file with 0 additions and 1 deletion.
    1 change: 0 additions & 1 deletion Macros.swift
    Original file line number Diff line number Diff line change
    @@ -17,7 +17,6 @@ import Foundation
    }
    #else
    func dLog(message: String, filename: String = __FILE__, function: String = __FUNCTION__, line: Int = __LINE__) {
    NSLog("[\(filename.lastPathComponent):\(line)] \(function) - \(message)")
    }
    #endif
    func aLog(message: String, filename: String = __FILE__, function: String = __FUNCTION__, line: Int = __LINE__) {
  2. @xmzio xmzio revised this gist Jun 14, 2014. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions Macros.swift
    Original file line number Diff line number Diff line change
    @@ -7,6 +7,10 @@ import Foundation


    // dLog and aLog macros to abbreviate NSLog.
    // Use like this:
    //
    // dLog("Log this!")
    //
    #if DEBUG
    func dLog(message: String, filename: String = __FILE__, function: String = __FUNCTION__, line: Int = __LINE__) {
    NSLog("[\(filename.lastPathComponent):\(line)] \(function) - \(message)")
  3. @xmzio xmzio created this gist Jun 14, 2014.
    21 changes: 21 additions & 0 deletions Macros.swift
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,21 @@
    //
    // Macros.swift
    //
    // Created by Xavier Muñiz on 6/12/14.

    import Foundation


    // dLog and aLog macros to abbreviate NSLog.
    #if DEBUG
    func dLog(message: String, filename: String = __FILE__, function: String = __FUNCTION__, line: Int = __LINE__) {
    NSLog("[\(filename.lastPathComponent):\(line)] \(function) - \(message)")
    }
    #else
    func dLog(message: String, filename: String = __FILE__, function: String = __FUNCTION__, line: Int = __LINE__) {
    NSLog("[\(filename.lastPathComponent):\(line)] \(function) - \(message)")
    }
    #endif
    func aLog(message: String, filename: String = __FILE__, function: String = __FUNCTION__, line: Int = __LINE__) {
    NSLog("[\(filename.lastPathComponent):\(line)] \(function) - \(message)")
    }