Hello Joaquim,
It is correct that the SmartInspect library gets compiled into the .exe by default (you also have the option to use it as an external .bpl), so this shouldn't cause the problem. No external libraries or applications are needed. If logging is configured correctly (i.e. setting Si.Enabled to True and setting the connections string to log to a file), then it's likely that the SmartInspect library encounters a problem while trying to open the specified log file. For example, it's likely to be a permission problem on the target machine (or maybe the target directory does not exist). In which directory do you try to log?
The reason why you do not see an error is that the library does not raise an exception but rather uses a special event to report exceptions in order to not change the exception behavior of your application. This event is called OnError can be used as follows:
unit Unit2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, SiAuto, SmartInspect, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
procedure OnError(ASender: TSmartInspect; AException: Exception);
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
Si.OnError := OnError;
Si.Connections := 'file(filename="c:\log.sil")';
Si.Enabled := True;
end;
procedure TForm1.OnError(ASender: TSmartInspect; AException: Exception);
begin
ShowMessage(AException.Message);
end;
end.
More information about the error handling of the libraries can be found in the online help (press F1 in the Console) under "Working with SmartInspect | Library Error Handling".