Difference between revisions of "MultiLog"

From Lazarus wiki
Jump to navigationJump to search
Line 46: Line 46:
  
 
=== Download ===
 
=== Download ===
Most recent: Multilog 0.5 and Multilog Viewer 0.3.
+
Most recent: Multilog 0.5 and Multilog Viewer 0.3 [https://luipack.bountysource.com/downloads LuiPack/BountySource] 
  
[https://luipack.bountysource.com/downloads LuiPack/BountySource] 
+
Older: Multilog 0.4 and Multilog Viewer 0.2 [http://sourceforge.net/project/showfiles.php?group_id=92177&package_id=193436 Lazarus CCR]
 
 
Older: Multilog 0.4 and Multilog Viewer 0.2
 
[http://sourceforge.net/project/showfiles.php?group_id=92177&package_id=193436 Lazarus CCR]
 
  
 
=== Change Log ===
 
=== Change Log ===

Revision as of 18:11, 29 March 2008

English (en)

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.

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

Features:

  • 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:

Multilogviewer.png

Author

Luiz Américo Pereira Câmara aka Karl Brandt

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

License

Modified LGPL

Download

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

  • 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

  • Base Library (Multilog unit)
    • fpc 2.0.4
  • LCL (MultilogLcl unit)
    • Lazarus 0.9.20 or above
  • SimpleLogViewer
    • Lazarus 0.9.20 or above
  • Multilog Viewer
    • Lazarus 0.9.20 or above
    • Virtual Treeview component
    • ATBinHex component (get from svn)
    • MiscUtils package (get from svn)

Usage

  • 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