Are there some FPC/Lazarus class for logging events?
Mailing lists / lazarus / 2010-10
Logging class or some kind of writeln for Lazarus
5 messages · 5 people · –
- FFrank Church 1
- GGraeme Geldenhuys 1
- MMichael Van Canneyt 1
- TThierry Coq 1
- VVincent Snijders 1
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
Frank Church wroteAre there some? FPC/Lazarus class for logging events?
Several:
- TEventLog writes to the system log or file.
Installed by default on tab System.
- I think there is also multilog in Lazarus CCR ?
- tiOPF contains tiLog. It writes to file, but is extensible.
Michael.
Are there some FPC/Lazarus class for logging events? Frank Church =======================
2010/10/22 Frank Church :
Are there some? FPC/Lazarus class for logging events?
Some kind of writeln is DebugLn:
http://wiki.freepascal.org/Lazarus_Faq#How_can_I_see_debug_output.3F
Vincent
Are there some FPC/Lazarus class for logging events? Frank Church =======================
There is also TLog4Delphi class. I don't know if it is ported to FPC yet.
Frank Church wrote 17 lines
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20101023/ca23ccbe/attachment.html>
Are there some FPC/Lazarus class for logging events? Frank Church =======================
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 -
