Geen cache-versie.

Caching uitgeschakeld. Standaardinstelling voor deze pagina:ingeschakeld (code LNG204)
Als het scherm te langzaam is, kunt u de gebruikersmodus uitschakelen om de cacheversie te bekijken.
java.util.logging

Class Formatter

  • Direct Known Subclasses:
    SimpleFormatter, XMLFormatter

    public abstract class Formatter
    extends Object
    A Formatter provides support for formatting LogRecords.

    Typically each logging Handler will have a Formatter associated with it. The Formatter takes a LogRecord and converts it to a string.

    Some formatters (such as the XMLFormatter) need to wrap head and tail strings around a set of formatted records. The getHeader and getTail methods can be used to obtain these strings.

    Since:
    1.4
    • Constructor Detail

      • Formatter

        protected Formatter()
        Construct a new formatter.
    • Method Detail

      • format

        public abstract String format(LogRecord record)
        Format the given log record and return the formatted string.

        The resulting formatted String will normally include a localized and formatted version of the LogRecord's message field. It is recommended to use the formatMessage(java.util.logging.LogRecord) convenience method to localize and format the message field.

        Parameters:
        record - the log record to be formatted.
        Returns:
        the formatted log record
      • getHead

        public String getHead(Handler h)
        Return the header string for a set of formatted records.

        This base class returns an empty string, but this may be overridden by subclasses.

        Parameters:
        h - The target handler (can be null)
        Returns:
        header string
      • getTail

        public String getTail(Handler h)
        Return the tail string for a set of formatted records.

        This base class returns an empty string, but this may be overridden by subclasses.

        Parameters:
        h - The target handler (can be null)
        Returns:
        tail string
      • formatMessage

        public String formatMessage(LogRecord record)
        Localize and format the message string from a log record. This method is provided as a convenience for Formatter subclasses to use when they are performing formatting.

        The message string is first localized to a format string using the record's ResourceBundle. (If there is no ResourceBundle, or if the message key is not found, then the key is used as the format string.) The format String uses java.text style formatting.

        • If there are no parameters, no formatter is used.
        • Otherwise, if the string contains "{0" then java.text.MessageFormat is used to format the string.
        • Otherwise no formatting is performed.

        Parameters:
        record - the log record containing the raw message
        Returns:
        a localized and formatted message

Nederlandse vertaling

U hebt gevraagd om deze site in het Nederlands te bezoeken. Voor nu wordt alleen de interface vertaald, maar nog niet alle inhoud.

Als je me wilt helpen met vertalingen, is je bijdrage welkom. Het enige dat u hoeft te doen, is u op de site registreren en mij een bericht sturen waarin u wordt gevraagd om u toe te voegen aan de groep vertalers, zodat u de gewenste pagina's kunt vertalen. Een link onderaan elke vertaalde pagina geeft aan dat u de vertaler bent en heeft een link naar uw profiel.

Bij voorbaat dank.

Document heeft de 11/06/2005 gemaakt, de laatste keer de 04/03/2020 gewijzigd
Bron van het afgedrukte document:https://www.gaudry.be/nl/java-api-rf-java/util/logging/formatter.html

De infobrol is een persoonlijke site waarvan de inhoud uitsluitend mijn verantwoordelijkheid is. De tekst is beschikbaar onder CreativeCommons-licentie (BY-NC-SA). Meer info op de gebruiksvoorwaarden en de auteur.

Referenties

  1. Bekijk - html-document Taal van het document:fr Manuel PHP : https://docs.oracle.com

Deze verwijzingen en links verwijzen naar documenten die geraadpleegd zijn tijdens het schrijven van deze pagina, of die aanvullende informatie kunnen geven, maar de auteurs van deze bronnen kunnen niet verantwoordelijk worden gehouden voor de inhoud van deze pagina.
De auteur Deze site is als enige verantwoordelijk voor de manier waarop de verschillende concepten, en de vrijheden die met de referentiewerken worden genomen, hier worden gepresenteerd. Vergeet niet dat u meerdere broninformatie moet doorgeven om het risico op fouten te verkleinen.

Inhoudsopgave Haut