[Lazarus] DebugLn thread safety

Graeme Geldenhuys graemeg.lists at gmail.com
Wed Mar 30 09:16:03 CEST 2011


On 30/03/2011 01:05, cobines wrote:
> OK, thanks both for answers. DbgOutThreadLog function seems useful,
> but I need to write to console so I'll use DebugLn via Synchronize.

If you take a look at the tiOPF v2 available from SourceForge.net, it 
has tiLog, tiLogToGUI, tiLogToConsole, tiLogToEvent, tiLogToFile, 
tiLogToDebugServer etc...

No matter the final output, the Log(..) lines are all the same. There 
are even convenience log functions for outputting various variable types 
in a neatly formatter manner. You can even enable logging at runtime via 
a command line parameter, you can enable multiple output targets (eg: 
file and gui output). The logging is all thread safe, and some output 
targets have built-in cache so as not to slow down your application when 
you log a huge amount of data.

The tiOPF log units are quit independent, so your application doesn't 
need to be based on tiOPF classes just to use the logging facility.

   http://www.tiopf.com
   http://www.sourceforge.net/projects/tiopf/


Regards,
   - Graeme -

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/





More information about the Lazarus mailing list