菜单:Project-->Options-->Search Path引入地址
如:E:\Software\DelphiLib\loggerpro_1_3_1
interface uses LoggerPro, Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ComCtrls; type TfrmCallYFDemo = class(TForm) btn1: TButton; stat1: TStatusBar; grpLog: TGroupBox; mmoLog: TMemo; procedure btn1Click(Sender: TObject); procedure FormCreate(Sender: TObject); private FLog: ILogWriter; { Private declarations } public function Log: ILogWriter; end;
uses //LoggerPro.GlobalLogger, LoggerPro.VCLMemoAppender, LoggerPro.FileAppender, //LoggerPro.VCLListViewAppender, System.Win.ComObj; procedure TfrmCallYFDemo.FormCreate(Sender: TObject); begin FLog := BuildLogWriter([TVCLMemoLogAppender.Create(mmoLog,100,False,'%0:s [%2:s] %3:s [%4:s]'),TLoggerProFileAppender.Create(5,1000,'log')]); log.info('日志框架加载成功!','FormCreate'); end; function TfrmCallYFDemo.Log: ILogWriter; begin Result := FLog; end;
标签:end,ILogWriter,delphi,Vcl,System,TObject,xe,LoggerPro,好用 From: https://www.cnblogs.com/redhat588/p/18062975