title: Is there a way to pass self by default?
body: <p>I'm creating a <code>log</code> method which prints the info (similar to <a href="https://github.com/InderKumarRathore/MLog/blob/master/MLog.h" rel="nofollow">MLog</a>)</p>
  
  <pre><code>#define MDLog(format, ...) NSLog(@"&lt;%p&gt; %s [#%d]| "format@"\n\n", self, __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__)
  </code></pre>
  
  <p>I'm able to get the file name, method name and the line number but I want to print the address of the calling object as well for that I need <code>self</code>. <strong>But</strong> I don't want to pass self every time I call the <code>log</code> method. So is there a way to pass <code>self</code> by default?</p>
  
  <p>e.g.</p>
  
  <pre><code>func log(message: String, object: NSObject = __SELF_HERE__ , functionName: String = __FUNCTION__, fileName: String = __FILE__, lineNumber: Int = __LINE__) {
    print("\(message)")
    print("\(functionName)")
    print("\(fileName)")
    print("\(lineNumber)")
    print("\(myObj)")
  }
  </code></pre>
  
  <p><br><br>
  <strong>P.S.</strong> Solutions I have in mind if nothing works.</p>
  
  <ol>
  <li>Pass <code>self</code> as parameter in the <code>log</code> method. (will prefer this one)</li>
  <li>Create extension for <code>NSObject/UIViewController</code> which have <code>log</code> method</li>
  </ol>