Top Description Methods
jdk.internal.net.http.common

public Interface Logger

extends Logger
Known Direct Implementers
jdk.internal.net.http.common.DebugLogger
Imports
java.util.function.Supplier

An internal System.Logger that is used for internal debugging purposes in the java.net.http module.

Though not enforced, this interface is designed for emitting debug messages with Level.DEBUG.

It defines log methods that default to Level.DEBUG, so that they can be called in statements like:

debug.log("some %s with %d %s", message(), one(), params());

Implementation Specification

This interface is implemented by loggers returned by Utils#getDebugLogger(Supplier), Utils#getWebSocketLogger(Supplier) and Utils#getHpackLogger(Supplier). It is not designed to be implemented by any other loggers. Do not use outside of this module.

Method Summary

Modifier and TypeMethod and Description
public default void
log(String
the string message (or a key in the message catalog, if this logger is a localized logger); can be null.
msg
)

Logs a message.

public default void
log(Supplier<String>
a supplier function that produces a message.
msgSupplier
)

Logs a lazily supplied message.

public default void
log(Object
the object to log.
obj
)

Logs a message produced from the given object.

public default void
log(String
the string message (or a key in the message catalog, if this logger is a localized logger); can be null.
msg
,
Throwable
a Throwable associated with the log message; can be null.
thrown
)

Logs a message associated with a given throwable.

public default void
log(Supplier<String>
a supplier function that produces a message.
msgSupplier
,
Throwable
a Throwable associated with log message; can be null.
thrown
)

Logs a lazily supplied message associated with a given throwable.

public default void
log(String
the string message format in String#format(String, Object...) or java.text.MessageFormat format, (or a key in the message catalog, if this logger is a localized logger); can be null.
format
,
Object...
an optional list of parameters to the message (may be none).
params
)

Logs a message with an optional list of parameters.

public default boolean
on()

Tells whether this logger is on.

Inherited from java.lang.System.Logger:
getNameisLoggableloglogloglogloglogloglog

Method Detail

logback to summary
public default void log(String msg)

Logs a message.

Implementation Specification

The default implementation for this method calls this.log(Level.DEBUG, msg);

Parameters
msg:String

the string message (or a key in the message catalog, if this logger is a localized logger); can be null.

logback to summary
public default void log(Supplier<String> msgSupplier)

Logs a lazily supplied message.

Implementation Specification

The default implementation for this method calls this.log(Level.DEBUG, msgSupplier);

Parameters
msgSupplier:Supplier<String>

a supplier function that produces a message.

Exceptions
NullPointerException:
if msgSupplier is null.
logback to summary
public default void log(Object obj)

Logs a message produced from the given object.

Implementation Specification

The default implementation for this method calls this.log(Level.DEBUG, obj);

Parameters
obj:Object

the object to log.

Exceptions
NullPointerException:
if obj is null.
logback to summary
public default void log(String msg, Throwable thrown)

Logs a message associated with a given throwable.

Implementation Specification

The default implementation for this method calls this.log(Level.DEBUG, msg, thrown);

Parameters
msg:String

the string message (or a key in the message catalog, if this logger is a localized logger); can be null.

thrown:Throwable

a Throwable associated with the log message; can be null.

logback to summary
public default void log(Supplier<String> msgSupplier, Throwable thrown)

Logs a lazily supplied message associated with a given throwable.

Implementation Specification

The default implementation for this method calls this.log(Level.DEBUG, msgSupplier, thrown);

Parameters
msgSupplier:Supplier<String>

a supplier function that produces a message.

thrown:Throwable

a Throwable associated with log message; can be null.

Exceptions
NullPointerException:
if msgSupplier is null.
logback to summary
public default void log(String format, Object... params)

Logs a message with an optional list of parameters.

Implementation Specification

The default implementation for this method calls this.log(Level.DEBUG, format, params);

Parameters
format:String

the string message format in String#format(String, Object...) or java.text.MessageFormat format, (or a key in the message catalog, if this logger is a localized logger); can be null.

params:Object[]

an optional list of parameters to the message (may be none).

onback to summary
public default boolean on()

Tells whether this logger is on.

Implementation Specification

The default implementation for this method calls this.isLoggable(Level.DEBUG);