display error message in standard format and pass to logging and monitoring services
lfmt uses format for
printf-style formatting of args.
lfmt encapsulates the output in the
standard error message format and
displays the output on stderr.
In addition, lfmt forwards its output
to the logging and monitoring facility.
The following options are available.
The keywords and definitions of the
standard levels of severity are:
Also display the output on the console, with a date
and time stamp.
Specify logging information as a
comma-separated list of keywords from the following sets:
Identifies the source of the condition.
soft (software), and
``Message source subclassification''
Identifies the type of software in which the problem is spotted.
util (utility), and
opsys (operating system).
Specify that a
localized version of format should be retrieved from a
locale-specific message database.
catalog indicates the message database that
contains the localized version of the format string.
catalog must be limited to 14 characters.
These characters must be selected from a set of all character values,
excluding ``\0'' (null) and the ASCII
codes for ``/'' (slash) and ``:'' (colon).
is a positive number that indicates the index of the string
into the message database.
If catalog does not exist in the current locale (identified by the
LC_MESSAGES or LANG environment variables),
or if msgid is out of bounds,
lfmt will attempt to retrieve the message from the C locale.
If this second retrieval fails, lfmt uses the format
string as passed on the command line.
lfmt will output
Message not found!!\n as the format string
if catalog is not a valid catalog name,
or if msgid is not a valid number as defined above.
Specify the label string to be displayed
with the message (for example, "UX:cat").
label is a character string no more than 25 characters in length;
it will be automatically suffixed with a colon (``:'').
When unspecified, no label is displayed as part of the message.
Specify the severity string to be
displayed with the message.
Acceptable strings include the standard severities in
either their print string
(that is, HALT, ERROR, INFO,
or keyword (that is, halt, error, info,
warn, and action) 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 (``:'').
The ERROR severity will be used if no severity is specified.
application has encountered a severe fault and is halting
application has detected a fault
application has detected a condition that is out of the ordinary and
might be a problem
application is providing information about a condition that is not in
do not print a severity message
Standard error message format
lfmt displays error messages in the following format:
label: severity: text
If no label was defined using the
-l label option, the message
is displayed in the format:
If lfmt is called twice to display an
error message and a helpful action or recovery message,
the output can look like the following:
label: severity: text
label: TO FIX: text
lfmt -f soft,util -l UX:test -s info "test facility enabled\n"
displays the message to stderr and makes it available for logging:
UX:test: INFO: test facility enabled
Upon success, lfmt exits with code 0.
Upon failure, lfmt exits with the following codes:
cannot log or forward to console
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004