I'm trying to implement a live monitor for ZeosLib. Instead of writing to a file, like the current monitor does, I want to broadcast the message, for another application to pick up. A great example is the dbmon application that DevArt uses. Even better would be to implement their interface (we would have to check licensing here), however the TZLoggingEvent doesn't return a reference to the component that triggered the log entry, only some text being the Message property and some other values like the protocol, category and timestamp.
I'd propose something like this:
Code: Select all
TZLoggingEvent = class (TObject)
constructor Create(Category: TZLoggingCategory; Protocol: string;
Msg: string; ErrorCode: Integer; Error: string; Component:TComponent);
Once we have a component reference in TZLoggingEvent, we can then query that component on its properties to determine valuable information that otherwise would get lost.
For example, sometimes you see SQL passing by and you wonder where in the application it gets executed. What's the name of the component that executes this query? What are its parameters values? etc..
I know that changing the constructor of TZLoggingEvent, would mean changing every call to it everywhere in the code, but that can parsed easily (passing nil by default is not an option, as it would result in the same situation as before).
Remarks? Should I prepare a patch?