delphimvcframework/samples/customlogger/CustomLoggerConfigU.pas

30 lines
621 B
ObjectPascal
Raw Normal View History

2016-11-27 23:17:20 +01:00
unit CustomLoggerConfigU;
interface
uses
LoggerPro; // loggerpro core
function GetLogger: ILogWriter;
implementation
uses
System.IOUtils
, LoggerPro.FileAppender // loggerpro file appender (logs to file)
{$IFDEF MSWINDOWS} , LoggerPro.OutputdebugStringAppender {$ENDIF} // loggerpro outputdebugstring appender (logs to the debugger)
;
2016-11-27 23:17:20 +01:00
function GetLogger: ILogWriter;
begin
Result := BuildLogWriter([
TLoggerProFileAppender.Create(10, 1000, TPath.Combine('MyFolder', 'MyLogs'))
{$IFDEF MSWINDOWS}, TLoggerProOutputDebugStringAppender.Create{$ENDIF}
2016-11-27 23:17:20 +01:00
], nil, TLogType.Debug);
end;
end.