Forum > Debugger

How to write in the Lazarus IDE "Console In/output" window, on Linux

(1/1)

devEric69:
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:

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---{$mode objfpc}{$H+}{$DEFINE DebugOnlyThisUnit__uFoo1} ...\... uses{$If defined(DebugOnlyThisUnit__uFoo1)}LazLogger,{$EndIf} ...\...;

Then, I initialize like this (at the bottom of the unit):


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---initialization    {$If defined(DebugOnlyThisUnit__uFoo1)}    LazLogger.GetDebugLogger.UseStdOut:= True;    DebugLn('Init: hello world');    {$EndIf}  

and I dispatch in the unit some stuffs like this:


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---{$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...).

Navigation

[0] Message Index

Go to full version