61e3dea584fd29bc10d99120a480e37fea3e84da braney Thu Sep 27 17:11:23 2018 -0700 make sure bigWarn statements end up in the log. diff --git src/hg/hgTracks/bigWarn.c src/hg/hgTracks/bigWarn.c index 7eeb4ef..a7489ae 100644 --- src/hg/hgTracks/bigWarn.c +++ src/hg/hgTracks/bigWarn.c @@ -1,24 +1,25 @@ /* bigWarn -- shared handlers for displaying big/udc warn/error messages */ /* Copyright (C) 2011 The Regents of the University of California * See README in this or parent directory for licensing information. */ #include "common.h" #include "hgTracks.h" #include "container.h" #include "bigWarn.h" +#include "hgConfig.h" static int bigWarnNumLines(char *errMsg) /* Count number of lines in err msg */ { int n = countChars(errMsg, '\n'); int sl = strlen(errMsg); if ((sl > 0) && (errMsg[sl-1]!='\n')) ++n; return n; } char *bigWarnReformat(char *errMsg) /* Return a copy of the re-formatted error message, * such as breaking longer lines */ @@ -34,30 +35,35 @@ nl[0] = '\n'; ++nl; } } return result; } void bigDrawWarning(struct track *tg, int seqStart, int seqEnd, struct hvGfx *hvg, int xOff, int yOff, int width, MgFont *font, Color color, enum trackVisibility vis) /* Draw the network error message, for the first window only. * Use the entire screen space across all windows. */ { if (currentWindow != windows) return; + +// put the error message into the log +if (sameString(cfgOptionDefault("bigWarn", "on"), "on")) + fprintf(stderr, "bigWarn: %s\n", tg->networkErrMsg); + int clipXBak, clipYBak, clipWidthBak, clipHeightBak; hvGfxGetClip(hvg, &clipXBak, &clipYBak, &clipWidthBak, &clipHeightBak); hvGfxUnclip(hvg); hvGfxSetClip(hvg, fullInsideX, yOff, fullInsideWidth, tg->height); xOff = fullInsideX; width = fullInsideWidth; char message[1024]; Color yellow = hvGfxFindRgb(hvg, &undefinedYellowColor); char *errMsg = bigWarnReformat(tg->networkErrMsg); char *nl = errMsg; int sl = strlen(errMsg); // in some cases, cannot use tg-> values, so recalc local equivalents. int heightPer = tl.fontHeight; /* Height per item line minus border. */ int lineHeight = heightPer+4; /* Height per item line including border. */