Difference between revisions of "MultiLog"

From Lazarus wiki
Jump to navigationJump to search
Line 57: Line 57:
 
=== Usage ===
 
=== Usage ===
  
To be written. For now, look at the examples provided.
+
To be written. For now, look at the examples provided: the console application multilogproj.pas and the Lazarus application testmultilog.
  
 
=== Known Issues ===
 
=== Known Issues ===

Revision as of 01:38, 7 August 2006

About

MultiLog is a log system that aims flexibility and low overhead at same time. As the name suggests, it can be used to log to several targets as a text file, a visual control or to another application. Adding new targets is as easy as creating a class that implement two methods, one being optional. MultiLog is in general similar to CodeSite, Smart Inspect, Overseer and EstLogger but it does not follow closely any of them, implementing many things differently and, even, having some unique features.

Features:

  • Flexible:
    • It's possible to define up to 32 log classes and enable/disable any combination of them
    • There's overloaded functions for most used types: Integer, Float, Boolean, String, TStrings, TRect, TPoint
  • Low overhead:
    • If a log class is not active, all messages that belongs to it only do a check in the begin of the function and exit
    • In the future a fake TLogger class will be provided, so the overhead will be even smaller if desired
  • Main features found in the cited Log Systems are implemented:
    • SendException
    • Watches
    • Send TObject/TComponent info
  • Unique:
    • Implements conditional messages (using SendIf method): a message is sent if a boolean criteria is met
    • Implements a function (CalledBy) that returns if the current code was called by a method (Useful to debug the LCL)
    • Implements SendCallStack and SendHeapInfo: the name says all
    • Multiple CheckPoints


Here's the provided Log Viewer in action: MultiLogViewer.png

Author

Luiz Américo Pereira Câmara aka Karl Brandt

License

LGPL

Download

You can download MultiLog 0.2 from here and MultiLogViewer 0.1 from here

Change Log

  • 12/06/06: Version 0.1 - initial release
  • 06/08/06: Version 0.2
    • Implemented overloaded Send method for TObject and Float
    • Implemented Watches
    • Implemented CheckPoints
    • Implemented SendHeapInfo and SendException
    • Created a full LogViewer with support for Watches, CallStack and message filtering

System Requirements

Created and tested with Lazarus 0.9.17 + fpc204rc2 although 0.9.16+fpc202 should work.

  • Remarks
    • For compiling the MultiLogViewer is necessary the VirtualTreeview package
    • Its possible to use the multilog, ipcchannel, filechannel units in console applications which requires only fpc 2.0.2
    • Version 0.2 was not tested under GTK/Linux. Version 0.1 was working.

Usage

To be written. For now, look at the examples provided: the console application multilogproj.pas and the Lazarus application testmultilog.

Known Issues

  • In my setup (Lazarus 0.9.15 + fpc 2.0.2 + Windows XP), is necessary add the directory where is the package sources to the Units path in the Compiler Options. This occurs, i think, because fpc tries to recompile a unit even after finding it in $(PkgDir)\lib\$(TargetCPU)-$(TargetOS)\. It seems a fpc bug since sometimes a Internal Error is given
  • While developing MultiLog i had some problems with inlines, so for now only a few critical inlines are used. Disable them if you get a internal error while compiling.