Thanks JuhaManninen for your reply. Switching my program to another Lazarus version now is not an option.
Thank you very much Martin_fr for that solution.
LazLogger.DebugLogger:=TLazLoggerNoOutput.Create;
did not compile (Error: Incompatible type for arg no. 1: Got "TLazLoggerNoOutput", expected "TLazLoggerFile"), but this line does compile and works perfectly:
LazLoggerBase.DebugLogger:=TLazLoggerNoOutput.Create;
Meanwhile I found another "solution" by playing with the interface variables of Unit 'LazLoggerBase':
LazLoggerBase.LazDebugLoggerCreator:=nil;
The advantage of this way is, that I can save & restore it's value, so that only my known command, which produces the debug warning, runs with 'DebugLn' disabled and I could see other warnings, if any would occur some day.
My question is now: how "dirty" is my method? Are there reasons, not to do so?