da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.ds ;G \\*(;G\\f\\$1\\$3\\f\\$2
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.if !\\$4 .Af \\$2 \\$1 "\\$4" "\\$5" "\\$6" "\\$7" "\\$8" "\\$9"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.ie \\$3 .ft \\$1
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.nr ;G \\n(.f
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.Af "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7" "\\$8" "\\$9"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.ft \\n(;G \}
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.aF 5 \\n(.f "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.aF 5 1 "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.aF 1 5 "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.de EX \" start example
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.ta 1i 2i 3i 4i 5i 6i
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.de EE \" end example
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.TH ERROR 3
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinerror \- error and debug trace message formatter
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.SH SYNOPSIS
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinError_info_t error_info;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinvoid error(int \fIlevel\fP, ...);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinvoid errorv(const char* \fIlibrary\fP, int \fIlevel\fP, va_alist \fIargs\fP);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinvoid liberror(const char* \fIlibrary\fP, int \fIlevel\fP, ...);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chindebug(\fIstatement\fP)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinmessage((int \fIlevel\fP, ...))
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinlibmessage((const char* \fIlibrary\fI, int \fIlevel\fP, ...))
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.SH DESCRIPTION
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinis the error and debug trace message formatter.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinis the severity level.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinMessages with
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinare suppressed.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinis initially
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinThe remaining arguments are passed on to
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.LR printf .
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinis appended to the message text, so none should appear in the
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinthen messages with
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.I "level > 0"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinare prefixed by
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinBefore the message text is output to standard error
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinit is passed to the function
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.LR "char* ERROR_translate(const char* \fItext\fP, int \fIflag\fP)" .
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.L ERROR_translate
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinreturns the
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinargument, but on some systems it may do language translation via lookup
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinon the original source text.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.RL ( error
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.L ERROR_translate
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinmay be one of:
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinNegative values are for debug tracing.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinDebug messages are prefixed with
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.BI debug level.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinand the error text for errno is appended to the message.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.B "ERROR_INFO [0]"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinInformation only; no prefixes are added to the message.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.B "ERROR_WARNING [1]"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.L "warning:"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinis added after
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinis incremented.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.I "ERROR_ERROR [2]"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin(soft error)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinis incremented.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.B ">= ERROR_FATAL [3]"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin(hard error)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinis incremented and
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.L exit(\fIlevel\fP\-2)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinis called after the message is emitted.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.B "ERROR_PANIC [77]"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin(unrecoverable internal error)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.L "panic:"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinis added after
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinThe following may be inclusive-or'd into
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinfor alternate behavior:
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.L ERROR_SYSTEM
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinThe error text for
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinis appended to the message.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.L ERROR_OUTPUT
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinThe next argument is the file descriptor where the error message
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinshould be emitted.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.L ERROR_SOURCE
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinThen next two arguments are a file name and line number that are added
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinto the message after
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.L ERROR_USAGE
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinA usage message is emitted.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.L ERROR_PROMPT
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinThe trailing
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinis suppressed.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.L ERROR_NOID
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinprefix is suppressed.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.L ERROR_LIBRARY
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinThe message is from a library routine.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.SH ENVIRONMENT
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinThe elements of the global struct
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.I error_info
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chincontrol error output and actions.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.I error_info
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chincan be initialized from the
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.L ERROR_OPTIONS
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinenvironment variable.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.L ERROR_OPTIONS
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chincontains space separated
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.IR name [ =value ]
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinoptions, described below.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.I "int core"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chingenerates a core dump.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinInitialized by
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinERROR_OPTIONS="core=\fIlevel\fP"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chincan be a number or one of
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.LR error ,
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.LR fatal ,
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.LR panic .
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinis a handy way to get a stack trace at the exact point of error.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinthen the error message text is suppressed.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinmay still be called if appropriate for
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.IR level .
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinInitialized by
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinERROR_OPTIONS="trace=\fIlevel\fP"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinis set to the negative of
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.IR level .
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinLibrary error messages, suppressed by default, are enabled by
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinERROR_OPTIONS="library"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinmessage text can be forced for each message by
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinERROR_OPTIONS="system"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.SH "EXTENDED DESCRIPTION"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinprovides debugging message macros when
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinare defined
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.RL ( _TRACE_
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinis defined by
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.I makerules
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinAll of the macros expand to nothing when both
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinare not defined.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinexpands its arg and
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.L libmessage
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.L liberror
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinrespectively if
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinNotice that
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.L libmessage
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinare macro hacks that require double parentheses ((...)) around the
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin.SH EXAMPLE
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinTo enable debugging message level -3, library messages, and system
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chintext for all commands:
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinexport ERROR_OPTIONS="trace=3 library system"