Command Listeners

I am implementing a system wide categorized log processor, and I have included the ability to register listeners thinking on the CommandListener used to get the SQL commands generated by Aurelius.


However after implementing many thing I paid attention that the Interface defined for it does not have the GUID identification, making invalid the work I have done.

Not sure this is the appropriate way to do that, but I would like to ask to add an interface Identifier.

unit Aurelius.Commands.Listeners;

{$I Aurelius.inc}

interface

uses
  Generics.Collections,
  Aurelius.Drivers.Interfaces;

type
  ICommandExecutionListener = interface
    procedure ExecutingCommand(SQL: string; Params: TEnumerable<TDBParam>);
  end;

Right now, I am adding an identifier while I see what to do, however if that is possible would be appreciate. (I know there is channel for requisitions, but this one is so simple)


  ICommandExecutionListener = interface
    ['{74F0E3F8-1D25-4E96-95C1-063D6E54B4C2}']
    procedure ExecutingCommand(SQL: string; Params: TEnumerable<TDBParam>);
  end;

Thank you

Eduardo

This is an example on how I use, without the GUID I cannot query the interface:


procedure TNaharConnection.CreateDatabase;
var
  DatabaseManager: TDatabaseManager;
begin
  FConnectionAdapter.CreateDatabase;

  DatabaseManager := TDatabaseManager.Create(FConnection, FMappingExplorer);

  if LogManager.IsLogListenerRegistered('loglistener.aurelius') then
    DatabaseManager.AddCommandListener(LogManager.LogListener['loglistener.aurelius'] as ICommandExecutionListener);

  try
    DatabaseManager.BuildDatabase;
  finally
    DatabaseManager.Free;
  end;
end;