Difference between revisions of "MultiLog"

From Lazarus wiki
Jump to navigationJump to search
Line 83: Line 83:
=== System Requirements ===
=== System Requirements ===
* Base Library (Multilog unit)
* Base Library (MultiLog unit)
** fpc 2.0.4
** fpc 2.2.0
* LCL (MultilogLcl unit)
* LCL (MultilogLCL unit)
** Lazarus 0.9.20 or above
** Lazarus 0.9.24 or above
* SimpleLogViewer
* SimpleLogViewer
** Lazarus 0.9.20 or above
** Lazarus 0.9.24 or above
* Multilog Viewer
* Multilog Viewer
** Lazarus 0.9.20 or above
** Lazarus 0.9.24 or above
** [http://wiki.lazarus.freepascal.org/VirtualTreeview Virtual Treeview] component
** MultiLog
** ATBinHex component (get from [https://svn.bountysource.com/luipack/trunk/atbinhex svn])
** [https://luipack.bountysource.com/wiki/virtualtreeview Virtual Treeview]
** MiscUtils package (get from [https://svn.bountysource.com/luipack/trunk/miscutils svn])
** [https://luipack.bountysource.com/wiki/atbinhex ATBinHex]
** [http://wiki.lazarus.freepascal.org/UniqueInstance Unique Instance]
** [https://luipack.bountysource.com/wiki/luicontrols Lui Controls]
=== Usage ===
=== Usage ===

Revision as of 19:19, 29 March 2008

English (en)


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.

Starting from 0.5 version, the base library can be compiled with Delphi.


  • Flexible:
    • It's possible to define up to 32 log classes and enable/disable any combination of them
    • Each message can be associated with more than one class
    • 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
    • Named Counters
    • Send TObject/TComponent, TBitmap, Memory info
    • A log viewer application (MultiLog Viewer) with ability to track watches, callstack and filter messages
  • 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
    • Named CheckPoints
    • Ability to send custom messages through callback functions

Here's the provided Log Viewer in action:



Luiz Américo Pereira Câmara aka Karl Brandt

Contact: pascalive at bol(dot)com(dot)br


Modified LGPL


Most recent: Multilog 0.5 and Multilog Viewer 0.3 LuiPack/BountySource

Older: Multilog 0.4 and Multilog Viewer 0.2 Lazarus CCR

Change Log

  • 29/03/08
    • MultiLog 0.5
      • Can be compiled with Delphi
      • Enable inline
      • Several fixes
    • MultiLog Viewer 0.3
      • Added ability to see a watch history
      • Improved GUI usability
  • 19/05/2007 - MultiLog 0.4
    • Changed license to modified LGPL
    • Added named counters
    • A message can be associated with more than one class
  • 11/02/2007 - Multilog 0.3/Multilog Viewer 0.2
    • Multilog
      • Added SendCustomData, SendMemory methods
      • Added a TLogger descendant (TLCLLogger) which can send LCL specific data (TBitmap for now)
      • Cleaned the code
    • Multilog Viewer
      • Ability to display a memory area as hex values
      • Ability to display bitmaps
      • Improved usability
  • 06/08/2006 - Multilog 0.2
    • Implemented overloaded Send method for TObject and Float
    • Implemented Watches
    • Implemented CheckPoints
    • Implemented SendHeapInfo and SendException
    • Created a full LogViewer (MultiLog Viewer 0.1) with support for Watches, CallStack and message filtering
  • 12/06/2006 - Multilog 0.1
    • Initial release

System Requirements


  • Some usage examples can be found here
  • See the examples included in the demos folder

Known Issues

  • In my setup (Lazarus 0.9.17 + fpc 2.0.4rc2 + 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
    • To override this problem since version 0.2 the unit path of the lazarus package points to $(PkgDir). This has the drawback of breaking the "multienviroment" schema that separates binaries of different targets used in most packages.
      • As a side effect when compiling projects that requires multilog package, fpc will create duplicated units in the project path and Lazarus IDE warn about them. Just ignore the warnings.
  • While developing MultiLog i had some problems with inlines (See this bug). All inlines were commented. Because of this all calls to the overloaded SendCallStack that has a implicit classes (DefaultClasses) will have SENDCALLSTACK as the first frame. Use the explicit SendCallStack overloaded function as a workaround.
    • Waiting for fpc2.2 to re-enable inline