+
+ note
+
+
used to highlight the text detail
and
+ hint
in such messages
+
+
+
locus
- The default value is error=01;31:warning=01;35:locus=01
+ The default value is
+ error=01;31:warning=01;35:note=01;36:locus=01
(01;31 = bold red, 01;35 = bold
- magenta, 01 = bold default color).
+ magenta, 01;36 = bold cyan, 01 = bold
+ default color).
static const char *sgr_error = NULL;
static const char *sgr_warning = NULL;
+static const char *sgr_note = NULL;
static const char *sgr_locus = NULL;
#define SGR_ERROR_DEFAULT "01;31"
#define SGR_WARNING_DEFAULT "01;35"
+#define SGR_NOTE_DEFAULT "01;36"
#define SGR_LOCUS_DEFAULT "01"
#define ANSI_ESCAPE_FMT "\x1b[%sm"
sgr_error = strdup(value);
if (strcmp(name, "warning") == 0)
sgr_warning = strdup(value);
+ if (strcmp(name, "note") == 0)
+ sgr_note = strdup(value);
if (strcmp(name, "locus") == 0)
sgr_locus = strdup(value);
}
{
sgr_error = SGR_ERROR_DEFAULT;
sgr_warning = SGR_WARNING_DEFAULT;
+ sgr_note = SGR_NOTE_DEFAULT;
sgr_locus = SGR_LOCUS_DEFAULT;
}
}
}
break;
case PG_LOG_DETAIL:
+ if (sgr_note)
+ fprintf(stderr, ANSI_ESCAPE_FMT, sgr_note);
fprintf(stderr, _("detail: "));
+ if (sgr_note)
+ fprintf(stderr, ANSI_ESCAPE_RESET);
break;
case PG_LOG_HINT:
+ if (sgr_note)
+ fprintf(stderr, ANSI_ESCAPE_FMT, sgr_note);
fprintf(stderr, _("hint: "));
+ if (sgr_note)
+ fprintf(stderr, ANSI_ESCAPE_RESET);
break;
}
}