Hello,
How can I write to debug in the " View > Debug Windows > Console In/Output " window, from a
Linux Lazarus?
I've found this way that suits me. Personally, I write at the top of the unit:
{$mode objfpc}{$H+}
{$DEFINE DebugOnlyThisUnit__uFoo1}
...\...
uses
{$If defined(DebugOnlyThisUnit__uFoo1)}
LazLogger,
{$EndIf}
...\...;
Then, I initialize like this (at the bottom of the unit):
initialization
{$If defined(DebugOnlyThisUnit__uFoo1)}
LazLogger.GetDebugLogger.UseStdOut:= True;
DebugLn('Init: hello world');
{$EndIf}
and I dispatch in the unit some stuffs like this:
{$If defined(DebugOnlyThisUnit__uFoo1)}
DebugLn('Another stuff');
DebugLn('Bye bye');
{$EndIf}
Next, I need to run the application in a true debug mode (i.e. with the step by step, F9, etc, activated): only the output of the Lazarus application DebugLn are written here (there are no other messages like those from the GTK, the debugger, ...: in the terminal console, I have all the layers talking in it
): here, it's clearly only the application layer messages (if this tip can be useful to someone else...).