在Delphi OSX单元中是否有NSLog声明。我在火猴应用程序中找不到OutputDebugString的替代品。
最终的解决方案如下所示:
/// <remarks>
/// 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)
/// </remarks>
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;发布于 2015-02-07 21:30:19
在火猴中,在事件日志中显示消息的可移植方式是Log.d
uses FMX.Types;
...
Log.d('debugging');我认为从XE3开始就可以使用它。
https://stackoverflow.com/questions/12405447
复制相似问题