mirror of
https://github.com/danieleteti/delphimvcframework.git
synced 2024-11-16 16:25:54 +01:00
43 lines
608 B
ObjectPascal
43 lines
608 B
ObjectPascal
|
unit LoggerProConfig;
|
||
|
|
||
|
interface
|
||
|
|
||
|
uses
|
||
|
LoggerPro;
|
||
|
|
||
|
function Log: ILogWriter;
|
||
|
|
||
|
implementation
|
||
|
|
||
|
uses
|
||
|
LoggerPro.FileAppender,
|
||
|
LoggerPro.ConsoleAppender,
|
||
|
LoggerPro.OutputDebugStringAppender;
|
||
|
|
||
|
var
|
||
|
_Log: ILogWriter;
|
||
|
|
||
|
function Log: ILogWriter;
|
||
|
begin
|
||
|
Result := _Log;
|
||
|
end;
|
||
|
|
||
|
procedure SetupLogger;
|
||
|
const
|
||
|
{$IFDEF DEBUG}
|
||
|
LOG_LEVEL = TLogType.Debug;
|
||
|
{$ELSE}
|
||
|
LOG_LEVEL = TLogType.Warning;
|
||
|
{$ENDIF}
|
||
|
begin
|
||
|
_Log := BuildLogWriter([TLoggerProFileAppender.Create,
|
||
|
TLoggerProConsoleAppender.Create,
|
||
|
TLoggerProOutputDebugStringAppender.Create], nil, LOG_LEVEL);
|
||
|
end;
|
||
|
|
||
|
initialization
|
||
|
|
||
|
SetupLogger;
|
||
|
|
||
|
end.
|