mirror of
https://github.com/danieleteti/delphimvcframework.git
synced 2024-11-17 16:55:54 +01:00
b22a41ca91
0b6857bd Updated unit tests and automatic tasks 35d130d6 VERSION_1_4_4 2e4a80f4 Removed PasDoc documentation; Added unit tests for LogLayoutToLogFormat 8f61bc22 Removed TLogAppenderOptions, DEFAULT_LOG_FILENAME_FORMAT is now TLogLayout.* (there many possibilities); FileName layout use placeholders instead of indices (as format function does). be43f781 Merge branch 'master' into v2.0 git-subtree-dir: lib/loggerpro git-subtree-split: 0b6857bd8d51f5acb246561564b3c3bbd963d192
41 lines
678 B
ObjectPascal
41 lines
678 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;
|
|
begin
|
|
_Log := BuildLogWriter([TLoggerProFileAppender.Create,
|
|
TLoggerProConsoleAppender.Create,
|
|
TLoggerProOutputDebugStringAppender.Create]);
|
|
// only errors on console
|
|
_Log.Appenders[1].SetLogLevel(TLogType.Error);
|
|
// only warnings, errors or fatals on outputdebugstring
|
|
_Log.Appenders[2].SetLogLevel(TLogType.Warning);
|
|
end;
|
|
|
|
initialization
|
|
|
|
SetupLogger;
|
|
|
|
end.
|