Will think about it but for now:
def timer(myfile,db,f):
import time
t0=time.time()
f()
t0=time.time()-t0
myfile.wriite('%s: %s\n' % (t0,db._lastsql)
myfile=open('mylogfile.log','w')
rows=timer(myfile,db,lambda:db(db.table.id>0).select())
Massimo
On Dec 22, 1:04 am, Jonathan Benn <[email protected]> wrote:
> Hi,
>
> On Dec 22, 4:52 am, vince <[email protected]> wrote:
>
> > also is it possible to enable logging for all SQL query execution?
>
> Logging with a timer included would be really handy.
>
> Sincerely,
>
> --Jonathan
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py Web Framework" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---