# # # patch "ChangeLog" # from [a6fce5e7d204b81902747eb25004b88095a8ea9f] # to [6fd1a6142213717f77714ccf5c5cd8ba62c52b98] # # patch "database.cc" # from [8e5e51df5808453cd5320e72f334452c472ea6d6] # to [115a0a271a57f991e5cf58cb03b4325fde5aa1d4] # ============================================================ --- ChangeLog a6fce5e7d204b81902747eb25004b88095a8ea9f +++ ChangeLog 6fd1a6142213717f77714ccf5c5cd8ba62c52b98 @@ -1,5 +1,10 @@ 2006-01-11 Nathaniel Smith + * database.cc (fetch): Don't log all SQL unless requested by + user. + +2006-01-11 Nathaniel Smith + * po/Makevars (XGETTEXT_OPTIONS): * configure.ac: Tweak xgettext configuration to make intltool happier. ============================================================ --- database.cc 8e5e51df5808453cd5320e72f334452c472ea6d6 +++ database.cc 115a0a271a57f991e5cf58cb03b4325fde5aa1d4 @@ -588,22 +588,25 @@ int params = sqlite3_bind_parameter_count(i->second.stmt()); - L(F("binding %d parameters for %s\n") % params % query); + // profiling finds this logging to be quite expensive + if (global_sanity.debug) + L(F("binding %d parameters for %s\n") % params % query); for (int param = 1; param <= params; param++) { char *value = va_arg(args, char *); - // nb: transient will not be good for inserts with large data blobs - // however, it's no worse than the previous '%q' stuff in this regard - // might want to wrap this logging with --debug or --verbose to limit it - string log = string(value); + // profiling finds this logging to be quite expensive + if (global_sanity.debug) + { + string log = string(value); + + if (log.size() > constants::log_line_sz) + log = log.substr(0, constants::log_line_sz); + + L(F("binding %d with value '%s'\n") % param % log); + } - if (log.size() > constants::log_line_sz) - log = log.substr(0, constants::log_line_sz); - - L(F("binding %d with value '%s'\n") % param % log); - sqlite3_bind_text(i->second.stmt(), param, value, -1, SQLITE_TRANSIENT); assert_sqlite3_ok(sql()); }