Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ lfmt(1) — mips UMIPS RISC/os 5.01

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

gettxt(1)

pfmt(1)

printf(1)

lfmt(3C)

environ(5)



LFMT(1)             RISC/os Reference Manual              LFMT(1)



NAME
     lfmt - display error message in standard format and pass to
          logging and monitoring services

SYNOPSIS
     lfmt
     [-c] [-fflags]
     [-llabel] [-sseverity]
     [-gcatalog:msgnum] format [args]

DESCRIPTION
     lfmt uses format for printf style formatting of args.  If
     the g option is specified, lfmt retrieves a localized ver-
     sion of the format string from a locale-specific message
     database.  The output is displayed on stderr.

     lfmt encapsulates the output in the standard error message
     format.

     lfmt forwards its output to the logging and monitoring
     facility.  Optionally, lfmt will display the output on the
     console, with a date and time stamp.

     The c option causes the message to also be displayed along
     with a date/time stamp on the console.

     The -fflags option specifies logging information as a
     comma-separated list of keywords from the sets:

          Major classification
               Identifies the source of the condition.  Identif-
               iers are:  hard (hardware), soft (software), and
               firm (firmware).

          Message source subclassification
               Identifies the type of software in which the prob-
               lem is spotted.  Identifiers are:  appl (applica-
               tion), util (utility), and opsys (operating sys-
               tem).

     The -llabel option specifies the label string to be
     displayed with the message (e.g. "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.

     The -sseverity option specifies the severity string to be
     displayed with the message.  Acceptable strings include the
     standard severities in either their print string (i.e.,
     HALT, ERROR, INFO, WARNING, and "TO FIX") or keyword (i.e.
     halt, error, info, warn, and action) forms, or any other
     user-defined string.  A user-defined string will be assigned



                        Printed 11/19/92                   Page 1





LFMT(1)             RISC/os Reference Manual              LFMT(1)



     the integer severity value of 5.  The severity will be suf-
     fixed with a colon (:).  The ERROR severity will be used if
     no severity is specified.

     The -gcatalog:msgnum option specifies that a localized ver-
     sion of the format should be retrieved from a message data-
     base.  catalog is used to indicate the message database that
     contains the localized version of the format string.  cata-
     log must be limited to 14 characters.  These characters must
     be selected from a set of all characters values, excluding
     \0 (null) and the ASCII codes for / (slash) and : (colon).

     msgnum is a positive number that indicates the index of the
     string into the message database.

     If the catalog does not exist in the current locale (identi-
     fied by the LC_MESSAGES or LANG environment variables), or
     if the message number is out of bound, 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 format string if
     catalog is not a valid catalog name, or if msgnum is not a
     valid number.

STANDARD ERROR MESSAGE FORMAT
     lfmt displays error messages in the following format:

          label: severity: text

     If no label was defined using the -llabel option, the mes-
     sage is displayed in the format:
          severity: text





















 Page 2                 Printed 11/19/92





LFMT(1)             RISC/os Reference Manual              LFMT(1)



     If lfmt is called twice to display an error message and a
     helpful action or recovery message, the output can look
     like:

          label: severity: text
          label: TO FIX: text


ERRORS
     Upon success, lfmt exits with code 0.  Upon failure, lfmt
     exits with the following codes:

     1    write error.

     2    cannot log or forward to console.

     3    syntax error.

EXAMPLE
          lfmt -fsoft,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

SEE ALSO
     gettxt(1), pfmt(1), printf(1).
     lfmt(3C), environ(5) in the Programmer's Reference Manual.



























                        Printed 11/19/92                   Page 3



Typewritten Software • bear@typewritten.org • Edmonds, WA 98026