Top   Types   Functions   Classes   Index   Sources 

Command Line Options


Error Library Options
Options

Options of the Error Library

Error Library Options

There are two mechanisms for passing options to the error library.

Environment Variable

The error library reads the environment variable ERR_OPTIONS. It contains a space separated list of options.

Command Line

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:

ERR_OPTIONS='colourise=tty'

is equivalent to passing the option

--err-colourise=tty

to the program.

Command line options have precedence over the environment variable.

Options

colourise=0 or

colourise=1 or

colourise=tty

Defines whether in plain styles, ANSI colour sequences should be used to mark up the error message.

For programmers:

This option changes the library variable err_style_plain_color to one of the ERR_STYLE_COLOR_* options defined in style.h

style=i

Defines which error style to use by default.

i may be one of:

plain-colon

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.
plain-quotes

Selects the plain style with double quotes around the file names. Example:

Error: In "file.c", line 15(6):
    This is wrong.
plain

Selects the default plain style. This is either plain-colon or plain-quotes, depending on the setting of the sub-style= option.

qt

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.

qt3

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.

none

Nothing is output.

simple

No formatting is done: only the mere message texts are output.

For programmers:

sub-style=STYLE

Defines which style to be used for the default plain style. STYLE: may be one of:

colon

The style plain-colon is used.

quotes

The style plain-quotes is used.

For programmers:

- 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().

quiet=NUMBER

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:

NUMBER >= 6

fatal errors and assertions are hidden

NUMBER >= 5

errors and internal errors are hidden

NUMBER >= 4

warnings are hidden

NUMBER >= 3

informational messages are hidden

NUMBER >= 2

notes are hidden

NUMBER >= 1

progress messages are hidden

For programmers:

This option is equivalent to invoking err_set_quiet_level.

show=SPEC

hide=SPEC

issueSPEC

suppress=SPEC

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.

Note

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:

show-sub-system=SPEC

hide-sub-system=SPEC

issue-sub-system=SPEC

suppress-sub-system=SPEC

show-group=SPEC

hide-group=SPEC

issue-group=SPEC

suppress-group=SPEC

Set up filtering by sub-system or group. SPEC is a comma separated list of sub-system or group names.

color-plain=SPEC

Defines the ANSI color mark-up used for colourising plain style messages. Example to make the body of messages normal instead of bold:

color-plain=body.clear

Example to make the tag of error messages magenta:

color-plain=error.tag=35

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:

color-plain=clear-all:prefix=<:suffix=>:prefix.off=/:tag=b:error.tag=i

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:

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.

Index

Stoppt die Vorratsdatenspeicherung
November 26th, 2007
Comments? Suggestions? Corrections? You can drop me a line.
zpentrabvagiktu@theiling.de
Schwerpunktpraxis