On 02 Sep 2011 at 16:58, Stephan Beal <sgb...@googlemail.com> wrote: 

> On Fri, Sep 2, 2011 at 5:32 PM, Frans Knibbe <frans.kni...@geodan.nl> wrote:
>
>> If SQLite could log this statement including the comment, it would still be
>> possible to distinguish sources. Or reject the logging of statement with a
>> trigger similar to the one you proposed..
>>
>
> Why not just write a small wrapper function which does the logging and
> executes the statements? It could take additional arguments, e.g. a symbolic
> name for the source of the query (e.g. "app2.funcA()").

I use a wrapper function anyway, for these reasons:

1) So I can use try/catch. That allows me to handle any errors I may get in 
SQLite properly - logging the error and cleaning up.

2) So I can pass a small string which, when logged with any error message, can 
locate where the error occurred.


This would also allow me to implement a (circular) traceback buffer of 
statements.

--
Cheers  --  Tim
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to