07d10481f82757c5b853be2c3800959852481918
max
  Thu Apr 8 05:16:10 2021 -0700
adding tracking code for gbdb redirects to GBIB/GBIC, refs #27121

diff --git src/hg/lib/hdb.c src/hg/lib/hdb.c
index 9da9138..8fa937a 100644
--- src/hg/lib/hdb.c
+++ src/hg/lib/hdb.c
@@ -1498,30 +1498,33 @@
     return fileName;
 if (!startsWith("/gbdb/", fileName))
     return cloneString(fileName);
 
 char *path = hReplaceGbdbLocal(fileName);
 if (fileExists(path))
     return path;
 
 // if the file did not exist, replace with gbdbLoc2
 char* newGbdbLoc = cfgOption("gbdbLoc2");
 if (newGbdbLoc==NULL)
     return path;
 
 freeMem(path);
 path = replaceChars(fileName, "/gbdb/", newGbdbLoc);
+if (cfgOptionBooleanDefault("traceGbdb", FALSE))
+    fprintf(stderr, "REDIRECT gbdbLoc2 %s ", path);
+
 return path;
 }
 
 char *hReplaceGbdbSeqDir(char *path, char *db)
 /* similar to hReplaceGbdb, but accepts a nib or 2bit "directory" (basename) under
  * gbdb, like /gbdb/hg19 (which by jkLib is translated to /gbdb/hg19/hg19.2bit).
  hReplaceGbdb would check only if the dir exists. For 2bit basename, we
  have to check if the 2bit file exists, do the rewriting, then strip off the
  2bit filename again.
  This function works with .nib directories, but nib does not support opening
  from URLs.  As of Feb 2014, only hg16 and anoGam1 have no .2bit file.
 */
 {
 char buf[4096];
 safef(buf, sizeof(buf), "%s/%s.2bit", path, db);