Fossil

Check-in [99fea6cd]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Cause all SQLite errors to be logged as warnings.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 99fea6cde4ac1058d519d277ce6c7a91edde84f9
User & Date: drh 2010-03-31 14:52:38
Context
2010-03-31
15:17
Improvements to the SQLite error logging output format. check-in: b30e35fc user: drh tags: trunk
14:52
Cause all SQLite errors to be logged as warnings. check-in: 99fea6cd user: drh tags: trunk
14:35
When compiled with FOSSIL_DEBUG, print warnings if any SQLite queries fail to use indices. check-in: e95e87c1 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/main.c.

224
225
226
227
228
229
230

231
232
233
234
235
236
237
...
345
346
347
348
349
350
351





352
353
354
355
356
357
358
** This procedure runs first.
*/
int main(int argc, char **argv){
  const char *zCmdName;
  int idx;
  int rc;


  g.now = time(0);
  g.argc = argc;
  g.argv = argv;
  if( getenv("GATEWAY_INTERFACE")!=0 ){
    zCmdName = "cgi";
  }else if( argc<2 ){
    fprintf(stderr, "Usage: %s COMMAND ...\n", argv[0]);
................................................................................
  va_end(ap);
  if( g.cgiPanic ){
    cgi_printf("<p><font color=\"red\">%h</font></p>", z);
  }else{
    fprintf(stderr, "%s: %s\n", g.argv[0], z);
  }
}






/*
** Print a usage comment and quit
*/
void usage(const char *zFormat){
  fprintf(stderr, "Usage: %s %s %s\n", g.argv[0], g.argv[1], zFormat);
  exit(1);







>







 







>
>
>
>
>







224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
...
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
** This procedure runs first.
*/
int main(int argc, char **argv){
  const char *zCmdName;
  int idx;
  int rc;

  sqlite3_config(SQLITE_CONFIG_LOG, fossil_sqlite_log, 0);
  g.now = time(0);
  g.argc = argc;
  g.argv = argv;
  if( getenv("GATEWAY_INTERFACE")!=0 ){
    zCmdName = "cgi";
  }else if( argc<2 ){
    fprintf(stderr, "Usage: %s COMMAND ...\n", argv[0]);
................................................................................
  va_end(ap);
  if( g.cgiPanic ){
    cgi_printf("<p><font color=\"red\">%h</font></p>", z);
  }else{
    fprintf(stderr, "%s: %s\n", g.argv[0], z);
  }
}

/* Error logs from SQLite */
void fossil_sqlite_log(void *notUsed, int iCode, const char *zErrmsg){
  fossil_warning("SQLite error log (code %d): %s", iCode, zErrmsg);
}

/*
** Print a usage comment and quit
*/
void usage(const char *zFormat){
  fprintf(stderr, "Usage: %s %s %s\n", g.argv[0], g.argv[1], zFormat);
  exit(1);