unit BsoneDebug; interface uses System.SysUtils, System.DateUtils, Winapi.Windows, madCodeHook, madStrings, madTypes, GlobalDefine; procedure DVLOG(const AFormat: string; const AArgs: array of const); implementation var gdebug_: Boolean = true; procedure DVLOG(const AFormat: string; const AArgs: array of const); var Header: string; TimeStamp: string; LogMessage: string; FinalLog: string; FinalLogAnsi: AnsiString; begin if not gdebug_ then Exit; Header:= '[MGKIM]'; // TimeStamp := Format('[%08d:%08d] %s ', // [GetCurrentProcessId(), // GetCurrentThreadId(), // FormatDateTime('mm-dd hh:nn:ss', Now)] // ); try LogMessage := Format(AFormat, AArgs); except on E: Exception do LogMessage := '*** LOG FORMATTING ERROR: ' + E.Message + ' ***'; end; FinalLog := Header + TimeStamp + LogMessage; OutputDebugStringW(PChar(FinalLog)); //FinalLogAnsi := AnsiString(FinalLog); {$IFNDEF _BS1HP_} if Length(FinalLogAnsi) > 0 then begin SendIpcMessage(PAnsiChar(IPC_MESSAGE_STRING), PAnsiChar(FinalLogAnsi), Length(FinalLogAnsi)); end; {$ENDIF} end; end.