title: OutputDebugString() with Delphi for MacOS
body: <p>Is there an NSLog declaration in the Delphi OSX units. I failed to find a substitude for OutputDebugString in a Firemonkey application.</p>
  
  <p>The final solution looks like this:</p>
  
  <pre><code>/// &lt;remarks&gt;
  /// Output debug string. Output debug string can be seen in Delphi
  /// View|Debug Windows|Event Log or with 3-rd party programs such as
  /// dbgview.exe from SysInternals (www.sysinternals.com)
  /// &lt;/remarks&gt;
  procedure ODS(const Text: string);
  begin
    {$IFDEF MACOS}
    // http://stackoverflow.com/questions/12405447/outputdebugstring-with-delphi-for-macosunit unt_Debug;
    Log.d(Text);
    {$ENDIF}
    {$IFDEF LINUX}
    __write(stderr, AText, Length(AText));
    __write(stderr, EOL, Length(EOL));
    {$ENDIF}
    {$IFDEF MSWINDOWS}
    OutputDebugString(PWideChar(Text));
    {$ENDIF}
  end;
  </code></pre>