a83ffcfa578d5bf9b585582787c46ed9d9ddab9c braney Fri Jun 28 16:45:47 2019 -0700 put some information in the error log if new custom tracks are added so we can do a better job of tracking who is doing it. diff --git src/hg/lib/customTrack.c src/hg/lib/customTrack.c index 89937dd..578faff 100644 --- src/hg/lib/customTrack.c +++ src/hg/lib/customTrack.c @@ -17,30 +17,31 @@ #include "customTrack.h" #include "ctgPos.h" #include "psl.h" #include "gff.h" #include "genePred.h" #include "net.h" #include "hdb.h" #include "hui.h" #include "cheapcgi.h" #include "wiggle.h" #include "hgConfig.h" #include "customFactory.h" #include "trashDir.h" #include "jsHelper.h" +static boolean printSaveList = FALSE; // if this is true, we print to stderr the number of custom tracks saved /* Track names begin with track and then go to variable/value pairs. The * values must be quoted if they include white space. Defined variables are: * name - any text up to 15 letters. * description - any text up to 60 letters. * url - URL. If it contains '$$' this will be substituted with itemName. * visibility - 0=hide, 1=dense, 2=full, 3=pack, 4=squish * useScore - 0=use colors. 1=use grayscale based on score. * color = R,G,B, main color, should be dark. Components from 0-255. * altColor = R,G,B secondary color. * priority = number. */ struct trackDb *customTrackTdbDefault() /* Return default custom table: black, dense, etc. */ @@ -588,30 +589,32 @@ } dyStringFree(&ds); carefulClose(&f); } void customTracksSaveCart(char *genomeDb, struct cart *cart, struct customTrack *ctList) /* Save custom tracks to trash file for database in cart */ { char *ctFileVar = customTrackFileVar(cartString(cart, "db")); if (ctList) { static struct tempName tn; trashDirFile(&tn, "ct", CT_PREFIX, ".bed"); char *ctFileName = tn.forCgi; cartSetString(cart, ctFileVar, ctFileName); + if (printSaveList) + fprintf(stderr, "customTrack: saved %d in %s\n", slCount(ctList), ctFileName); customTracksSaveFile(genomeDb, ctList, ctFileName); } else { /* no custom tracks remaining for this assembly */ cartRemove(cart, ctFileVar); cartRemovePrefix(cart, CT_PREFIX); } } boolean customTrackIsCompressed(char *fileName) /* test for file suffix indicating compression */ { char *fileNameDecoded = cloneString(fileName); cgiDecode(fileName, fileNameDecoded, strlen(fileName)); @@ -928,30 +931,36 @@ if (html && differentString(html, ct->tdb->html)) { ct->tdb->html = html; changedCt = TRUE; } } break; } } } cartRemove(cart, CT_SELECTED_TABLE_VAR); } /* merge new and old tracks */ numAdded = slCount(newCts); +if (numAdded) + { + fprintf(stderr, "customTrack: new %d from %s\n", numAdded, customText); + printSaveList = TRUE; + } + ctList = customTrackAddToList(ctList, newCts, &replacedCts, FALSE); for (ct = ctList; ct != NULL; ct = ct->next) if (trackDbSetting(ct->tdb, CT_UNPARSED)) { ctRemoveFromSettings(ct, CT_UNPARSED); changedCt = TRUE; } if (newCts || removedCt || changedCt || ctConfigUpdate(ctFileName)) { customTracksSaveCart(genomeDb, cart, ctList); // If all CTs have been removed then customTrackFileVar is also removed from cart, so optional: ctFileName = cartOptionalString(cart, customTrackFileVar(genomeDb)); } if (cgiScriptName() && !endsWith(cgiScriptName(),"hgCustom"))