There are two mechanisms for passing options to the error library.
The error library reads the environment variable ERR_OPTIONS. It contains a space separated list of options.
The error library parses the command line and extract options from it. All options meant to be for the error library start with '--err-'. The options below are given without this prefix.
E.g. setting the environment variable:
is equivalent to passing the option
to the program.
Command line options have precedence over the environment variable.
Defines whether in plain styles, ANSI colour sequences should be used to mark up the error message.
This option changes the library variable err_style_plain_color to one of the ERR_STYLE_COLOR_* options defined in style.h
Defines which error style to use by default.
i may be one of:
Selects the plain style with colons. The characteristics of this style is that error locations are printed separated by colons like many GNU Tools do. Example:
file.c:15:6: Error: This is wrong.
Selects the plain style with double quotes around the file names. Example:
Error: In "file.c", line 15(6): This is wrong.
Selects the default plain style. This is either plain-colon or plain-quotes, depending on the setting of the sub-style= option.
Selects a style that marks up messages with some simple HTML like mark-ups. This may be used when running the application in a Qt-GUI-Application. Depending on the sub-style= option, the error messages are formatted like in plain-colon or plain-quotes style.
Selects a style that marks up messages with a lot of complex HTML like mark-ups. Its usage is similar to qt style. Again, the sub-style= option influences the formatting.
Nothing is output.
No formatting is done: only the mere message texts are output.
Defines which style to be used for the default plain style. STYLE: may be one of:
The style plain-colon is used.
The style plain-quotes is used.
- This option changes the library variable err_style_plain_redirect to one of the ERR_STYLE_PLAIN_* options defined in style-plain.h - The default plain style is selected for a stream by using err_style_plain as the err_style_t const * argument to err_add_stream().
Sets the quiet level of the library to NUMBER. This option always switches off messages, never on. A more general and fine-grained way of setting up the message filtering are the hide, show, issue and suppress options. Depending on NUMBER, messages are not shown anymore:
fatal errors and assertions are hidden
errors and internal errors are hidden
warnings are hidden
informational messages are hidden
notes are hidden
progress messages are hidden
This option is equivalent to invoking err_set_quiet_level.
Defines which messages to show or hide or issue or suppress. The difference between hiding and suppressing a message is that hidden messages are still internally counted, so they might provoke a fatal error later.
Usually it is wise not to suppress messages from the command line or environment variables unless you know what you are doing! Fatal errors and assertion messages cannot be suppressed (but hidden). SPEC is a comma separated list of either message tag or message number. The following tags are recognised:
Set up filtering by sub-system or group. SPEC is a comma separated list of sub-system or group names.
Defines the ANSI color mark-up used for colourising plain style messages. Example to make the body of messages normal instead of bold:
Example to make the tag of error messages magenta:
This results in an ANSI control sequence of \033[35mError:\033[0m (where \033 is the ascii escape character) for the "Error" tag. Example to switch from ANSI to HTML mark-up that makes all tags bold, but the "error" tag italic:
SPEC is a colon separated list of commands that modify the table of mark-up strings. Each mark-up consists of a prefix, a possible negation prefix, a specific string for the tag and the message part, and a suffix. Instead of a negation prefix, there may be a negation suffix. Instead of a negation, there may be a specific string for terminating any open mark-up. Any string may be assigned or empty. If a specific string is empty, no mark-up is written at all (neither prefix, suffix, or the like). A command is either:
clear: clears all specific strings, but not the prefix, suffix, negation prefix, negation suffix or termination string.
clear-all: clears the whole table.
an assignment of a string in the form SPEC=STRING: SPEC is a period separated list of a comma seperated tag list, a comma separated part ist and possible the word off to specify the negation string.
banner=34 address=35 banner.tag=mystring banner.tag.off=anotherstring
The same tags are recognised as for hiding/suppressing options. Additionally, the tags no-class and none are recognised. All tags may be selected by using all. A group of tags may be negated by prefixing a minus sign to the list. A group of parts may be negated by prefixing a minus sign to the list.
-banner.body=test banner.-body=test -banner.-body,tag=test3
The following parts are recognised:
There are three special assignments:
To set the prefix of a mark-up.
To set the suffix of a mark-up.
To set the default terminator of a mark-up.
To set the negation prefix for all mark-ups.
To set the negation prefix for all mark-ups.
an erase command for a string. The syntax is like for assignments with =STRING replaced by .clear.
By default, ANSI codes are used. I.e., the prefix is \033[ (\033 is the escape character), the suffix is m and the termination string is 0.
Specific strings are set-up to be something like 01 for bold text, 01;31 for bold red text, etc.