Added Database Logging for Macro

md5sum a.out
2e58865da163926e3c3e6371227086ba  a.out

Define DATABASE_LOGGING to 1 to see all queries sent against the
database, and leave it undefined or defined as 0 to shut off database
logging.