Delphi - Logs record function implementation MsgDsp

Logs Record - function implementation MsgDsp

Most of the time, we do not want to appear in the form of interactive, this time we can put a Memo on the form, and then open a separate thread for monitoring, enabling messages to be displayed in real time, for developers to analyze.

The key code is as follows:

1 procedure TFrmMain.MsgDsp(v_Str: string);
2 begin
3   mm_log.Lines.Add('[' + SYS_USERNAME + '] - [' + v_Str + '] - [' + FormatDateTime('YYYY-MM-DD hh:mm:ss zzz', Now()) + ']');
4 end;

 

Guess you like

Origin www.cnblogs.com/jeremywucnblog/p/11484308.html