[Lazarus] Logging class or some kind of writeln for Lazarus
Graeme Geldenhuys
graemeg.lists at gmail.com
Mon Oct 25 09:02:47 CEST 2010
Op 2010-10-22 20:47, Frank Church het geskryf:
>
> Are there some FPC/Lazarus class for logging events?
Yes, tiOPF contains tiLog.pas unit and it's descendants. Even though your
project isn't based on tiOPF object model, the tiLog units are separated
and stand-alone, so you can us it in any application with ease.
tiOPF v2 includes:
- Log to File
- Log to Console
- Log to FPC Debug Server
- Log to System Log
- Log to GUI Window
- Log to Remote Server
...or any combination of the above.
I use the Log to GUI Window most. It also runs as a separate thread, and
logging is cached - so as not to slow down your application. At runtime you
see the window as your application starts. You can toggle at runtime which
log events you want to see (eg: Debug, Normal, Sql, Database connections,
Visitors etc...). There are many convenience functions for logging various
data types (eg: TtiObject, TStringList, TDataTime, String, Integer, Double,
etc..)
Due to the broken dbugintf (FPC/Lazarus Debug Server), and the
broken/unimplemented FPC DWARF2/3, and limited Object Pascl support by GDB,
an the many debugging limitations in Lazarus IDE, the tiOPF logging is by
far the most reliable. Setting up a few simple Code Templates make adding
log calls really quick.
Regards,
- Graeme -
--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://opensoft.homeip.net:8080/fpgui/
More information about the Lazarus
mailing list