Skip to content

Commit

Permalink
Minor refactor.
Browse files Browse the repository at this point in the history
  • Loading branch information
horacekj committed Feb 28, 2023
1 parent b7ee791 commit c0ce36e
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions src/hw/TechnologieRCS.pas
Original file line number Diff line number Diff line change
Expand Up @@ -307,14 +307,21 @@ procedure TRCS.DllOnLog(Sender: TObject; logLevel: TRCSLogLevel; msg: string);
if (not Self.log) then
Exit();

if (logLevel = TRCSLogLevel.llErrors) then
Logging.Log(UpperCase(Self.LogLevelToString(logLevel)) + ': ' + msg, llError, lsRCS)
else if (logLevel = TRCSLogLevel.llWarnings) then
Logging.Log(UpperCase(Self.LogLevelToString(logLevel)) + ': ' + msg, llWarning, lsRCS)
else if (logLevel = TRCSLogLevel.llDebug) then
Logging.Log(UpperCase(Self.LogLevelToString(logLevel)) + ': ' + msg, llDebug, lsRCS)
var systemLogLevel: TLogLevel;
case (logLevel) of
TRCSLogLevel.llErrors:
systemLogLevel := TLogLevel.llError;
TRCSLogLevel.llWarnings:
systemLogLevel := TLogLevel.llWarning;
TRCSLogLevel.llRawCommands:
systemLogLevel := TLogLevel.llDetail;
TRCSLogLevel.llDebug:
systemLogLevel := TLogLevel.llDebug;
else
Logging.Log(UpperCase(Self.LogLevelToString(logLevel)) + ': ' + msg, llInfo, lsRCS);
systemLogLevel := TLogLevel.llInfo;
end;

Logging.Log(UpperCase(Self.LogLevelToString(logLevel)) + ': ' + msg, systemLogLevel, lsRCS);
end;

procedure TRCS.DllOnModuleChanged(Sender: TObject; module: Cardinal);
Expand Down

0 comments on commit c0ce36e

Please sign in to comment.