173 lines
5.0 KiB
Groff
173 lines
5.0 KiB
Groff
'\"macro stdmacro
|
|
.if n .pH g1.lfmt @(#)lfmt 41.8 of 5/26/91
|
|
.\" Copyright 1991 UNIX System Laboratories, Inc.
|
|
.\" Copyright 1990 AT&T
|
|
.nr X
|
|
.nr X
|
|
.if \nX=0 .ds x} lfmt 1 "" "\&"
|
|
.if \nX=1 .ds x} lfmt 1 ""
|
|
.if \nX=2 .ds x} lfmt 1 "" "\&"
|
|
.if \nX=3 .ds x} lfmt "" "" "\&"
|
|
.TH \*(x}
|
|
.SH NAME
|
|
\f4lfmt\f1 \- display error message in standard format and pass to logging and monitoring services
|
|
.SH SYNOPSIS
|
|
.ft CW
|
|
.nf
|
|
lfmt [\-c] [\-f \f2flags\f4] [\-l \f2label\f4][\-s \f2severity\f4][\-G \f2icon\f4][\-g \f2catalog\f4:\f2msgid\f4] \f2format\f4 [\f2args\f4]
|
|
.ft 1
|
|
.fi
|
|
.SH DESCRIPTION
|
|
\f4lfmt\f1 uses \f2format\f1 for \f4printf\f1 style formatting of \f2args\f1.
|
|
\f4lfmt\f1 encapsulates the output in the standard error message format and
|
|
displays the output on \f2stderr\f1.
|
|
In addition, \f4lfmt\f1 forwards its output to the logging and monitoring facility.
|
|
.P
|
|
The following options are available.
|
|
.TP 12
|
|
\f4\-c\f1
|
|
Also write the output to the console logger device (\f4\/dev/conslog\f1),
|
|
with a date and time stamp. This device is not normally used with IRIX.
|
|
.TP 12
|
|
\f4\-f \f2flags\f1
|
|
Specify logging information as a
|
|
comma-separated list of keywords from the following sets:
|
|
.RS
|
|
.TP 12
|
|
\f2Major classification\f1
|
|
Identifies the source of the condition.
|
|
Identifiers are:
|
|
\f4hard\f1 (hardware),
|
|
\f4soft\f1 (software), and
|
|
\f4firm\f1 (firmware).
|
|
.TP 12
|
|
\f2Message source subclassification\f1
|
|
Identifies the type of software in which the problem is spotted.
|
|
Identifiers are:
|
|
\f4appl\f1 (application),
|
|
\f4util\f1 (utility), and
|
|
\f4opsys\f1 (operating system).
|
|
.RE
|
|
.TP 12
|
|
\f4\-G \f2icon\f1
|
|
When the output device is the graphics console start up screen
|
|
(called the ``textport''), this option causes the message
|
|
to be drawn in a structured alert message box. The \f2icon\f1
|
|
argument specifies which icon to use and is either 0, 1, 2, 3, or 4,
|
|
for Info, Progress, Question, Warning, or Action icons. This
|
|
option is intended to be used in start up and shut down scripts.
|
|
.RE
|
|
.TP 12
|
|
\f4\-g \f2catalog\f4:\f2msgid\f1
|
|
Specify that a
|
|
localized version of \f2format\f1 should be retrieved from a
|
|
locale-specific message database.
|
|
\f2catalog\f1 indicates the message database that
|
|
contains the localized version of the \f2format\f1 string.
|
|
\f2catalog\f1 must be limited to 14 characters.
|
|
These characters must be selected from a set of all character values,
|
|
excluding \f4\\0\f1 (null) and the \s-1ASCII\s+1 codes for \f4/\f1 (slash) and
|
|
\f4:\f1 (colon).
|
|
.sp.5
|
|
\f2msgid\f1
|
|
is a positive number that indicates the index of the string
|
|
into the message database.
|
|
.sp.5
|
|
If \f2catalog\f1 does not exist in the current locale (identified by the
|
|
\f4LC_MESSAGES\f1 or \f4LANG\f1 environment variables),
|
|
or if \f2msgid\f1 is out of bounds,
|
|
\f4lfmt\f1 will attempt to retrieve the message from the C locale.
|
|
If this second retrieval fails, \f4lfmt\f1 uses the \f2format\f1
|
|
string as passed on the command line.
|
|
.sp.5
|
|
\f4lfmt\f1 will output
|
|
\f4Message not found!!\\n\f1 as the \f2format\f1 string
|
|
if \f2catalog\f1 is not a valid catalog name,
|
|
or if \f2msgid\f1 is not a valid number as defined above.
|
|
.TP 12
|
|
\f4\-l \f2label\f1
|
|
Specify the label string to be displayed
|
|
with the message (for example, \f4"UX:cat"\f1).
|
|
\f2label\f1 is a character string no more than 25 characters in length;
|
|
it will be automatically suffixed with a colon (\f4:\f1).
|
|
When unspecified, no label is displayed as part of the message.
|
|
.TP 12
|
|
\f4\-s \f2severity\f1
|
|
Specify the severity string to be
|
|
displayed with the message.
|
|
Acceptable strings include the standard severities in either their print string
|
|
(that is, \f4HALT\f1, \f4ERROR\f1, \f4INFO\f1, \f4WARNING\f1, and
|
|
\f4"TO FIX"\f1) or keyword (that is, \f4halt\f1, \f4error\f1, \f4info\f1,
|
|
\f4warn\f1, and \f4action\f1) forms, or any other user-defined string.
|
|
A user-defined string will be assigned the integer severity value of 5.
|
|
The severity will be suffixed with a colon (\f4:\f1).
|
|
The \f4ERROR\f1 severity will be used if no severity is specified.
|
|
.SS "Standard Error Message Format"
|
|
\f4lfmt\f1 displays error messages in the following format:
|
|
.P
|
|
.RS
|
|
\f2label\f4: \f2severity\f4: \f2text\f1
|
|
.RE
|
|
.P
|
|
If no \f2label\f1 was defined using the \f4-l \f2label\f1 option, the message
|
|
is displayed in the format:
|
|
.P
|
|
.RS
|
|
\f2severity\f4: \f2text\f1
|
|
.RE
|
|
.P
|
|
If \f4lfmt\f1 is called twice to display an
|
|
error message and a helpful \f2action\f1 or recovery message,
|
|
the output can look like the following:
|
|
.P
|
|
.RS
|
|
\f2label\f4: \f2severity\f4: \f2text\f1
|
|
.br
|
|
\f2label\f4: TO FIX: \f2text\f1
|
|
.RE
|
|
.SH EXAMPLE
|
|
.P
|
|
Example 1:
|
|
.P
|
|
.RS
|
|
.ft 4
|
|
.nf
|
|
lfmt \-f soft,util \-l UX:test \-s info "test facility enabled\\n"
|
|
.ft 1
|
|
.fi
|
|
.RE
|
|
.P
|
|
displays the message to \f2stderr\f1 and makes it available for logging:
|
|
.P
|
|
.RS
|
|
.ft 4
|
|
.nf
|
|
UX:test: INFO: test facility enabled
|
|
.ft 1
|
|
.fi
|
|
.RE
|
|
.SH SEE ALSO
|
|
.na
|
|
\f4gettxt\fP(1),
|
|
\f4pfmt\fP(1),
|
|
\f4printf\fP(1),
|
|
\f4lfmt\fP(3C),
|
|
\f4pfmt\fP(3C),
|
|
\f4environ\fP(5),
|
|
\f4strace\fP(1),
|
|
\f4syslog\fP(1).
|
|
.ad
|
|
.SH DIAGNOSTICS
|
|
Upon success, \f4lfmt\f1 exits with code 0.
|
|
.P
|
|
Upon failure, \f4lfmt\f1 exits with the following codes:
|
|
.TP
|
|
1
|
|
write error.
|
|
.TP
|
|
2
|
|
cannot log or forward to console.
|
|
.TP
|
|
3
|
|
syntax error.
|