Which version of lazarus?
The code was changed in 0.9.31, but from review it appears, wince always had the issue. Other widgetsets use standard out, or drop the log, if there is no stdout.
Anyway, the real issue is to find, where "DebugLn" is called. This should probably not be called.
Before 0.9.31 finding and removing the call to debugln, is the only way I know.
With current 0.9.31, you can:
uses LazLoggerBase;
DebugLogger := TLazLoggerNoOutput.Create;