Top Description Inners Fields Constructors Methods
com.sun.javafx.logging

public Class PlatformLogger

extends Object
implements Logger
Class Inheritance
All Implemented Interfaces
java.lang.System.Logger
Known Direct Subclasses
com.sun.javafx.binding.Logging.ErrorLogger
Imports
java.lang.ref.WeakReference, java.util.HashMap, .Map, .ResourceBundle

Platform logger provides an API for the JavaFX components to log messages. It is an internal logger intended to be used by JavaFX modules. The PlatformLogger uses an underlying System.Logger obtained by calling java.lang.System.Logger#getLogger(String) PlatformLogger implements System.Logger as to facilitiate logging of calling class and method. Note : JDK internal loggers know to skip any calls from System.Logger classes when looking for the calling class / method.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
PlatformLogger.Level

PlatformLogger logging levels.

Field Summary

Modifier and TypeField and Description
private final System.Logger
private static final Map<String, WeakReference<PlatformLogger>>
private boolean

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public void
public void
public void
fine(String
the message
msg
)

Logs a FINE message.

public void
public void
fine(String msg, Object... params)

public void
finer(String
the message
msg
)

Logs a FINER message.

public void
public void
finer(String msg, Object... params)

public void
finest(String
the message
msg
)

Logs a FINEST message.

public void
public void
finest(String msg, Object... params)

public static synchronized PlatformLogger

Returns:

a PlatformLogger
getLogger
(String
the name of the logger
name
)

Returns a PlatformLogger of a given name.

public String

Returns:

the name of the platform logger.
getName
()

Implements java.lang.System.Logger.getName.

Gets the name for this platform logger.

private System.Logger.Level
public void
info(String
the message
msg
)

Logs an INFO message.

public void
public void
info(String msg, Object... params)

public boolean
isLoggable(System.Logger.Level
the log message level.
level
)

Implements java.lang.System.Logger.isLoggable.

Checks if a message of the given level would be logged by this logger.

public boolean

Returns:

whether a message of that level would be logged
isLoggable
(PlatformLogger.Level
the level
level
)

Returns true if a message of the given level would actually be logged by this logger.

public void
log(System.Logger.Level
the log message level.
level
,
ResourceBundle
a resource bundle to localize format; can be null.
bundle
,
String
the string message format in java.text.MessageFormat format, (or a key in the message catalog if bundle is not null); can be null.
format
,
Object...
an optional list of parameters to the message (may be none).
params
)

Implements java.lang.System.Logger.log.

Logs a message with resource bundle and an optional list of parameters.

public void
log(System.Logger.Level
the log message level.
level
,
ResourceBundle
a resource bundle to localize msg; can be null.
bundle
,
String
the string message (or a key in the message catalog, if bundle is not null); can be null.
msg
,
Throwable
a Throwable associated with the log message; can be null.
thrown
)

Implements java.lang.System.Logger.log.

Logs a localized message associated with a given throwable.

public void
severe(String
the message
msg
)

Logs a SEVERE message.

public void
public void
severe(String msg, Object... params)

public void
warning(String
the message
msg
)

Logs a WARNING message.

public void
public void
warning(String msg, Object... params)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

loggerProxyback to summary
private final System.Logger loggerProxy
loggersback to summary
private static final Map<String, WeakReference<PlatformLogger>> loggers
loggingEnabledback to summary
private boolean loggingEnabled

Constructor Detail

PlatformLoggerback to summary
protected PlatformLogger(System.Logger loggerProxy)

Method Detail

disableLoggingback to summary
public void disableLogging()
enableLoggingback to summary
public void enableLogging()
fineback to summary
public void fine(String msg)

Logs a FINE message.

Parameters
msg:String

the message

fineback to summary
public void fine(String msg, Throwable t)
fineback to summary
public void fine(String msg, Object... params)
finerback to summary
public void finer(String msg)

Logs a FINER message.

Parameters
msg:String

the message

finerback to summary
public void finer(String msg, Throwable t)
finerback to summary
public void finer(String msg, Object... params)
finestback to summary
public void finest(String msg)

Logs a FINEST message.

Parameters
msg:String

the message

finestback to summary
public void finest(String msg, Throwable t)
finestback to summary
public void finest(String msg, Object... params)
getLoggerback to summary
public static synchronized PlatformLogger getLogger(String name)

Returns a PlatformLogger of a given name.

Parameters
name:String

the name of the logger

Returns:PlatformLogger

a PlatformLogger

getNameback to summary
public String getName()

Implements java.lang.System.Logger.getName.

Gets the name for this platform logger.

Returns:String

the name of the platform logger.

Annotations
@Override
getSystemLoggerLevelback to summary
private System.Logger.Level getSystemLoggerLevel(PlatformLogger.Level l)
infoback to summary
public void info(String msg)

Logs an INFO message.

Parameters
msg:String

the message

infoback to summary
public void info(String msg, Throwable t)
infoback to summary
public void info(String msg, Object... params)
isLoggableback to summary
public boolean isLoggable(System.Logger.Level level)

Implements java.lang.System.Logger.isLoggable.

Doc from java.lang.System.Logger.isLoggable.

Checks if a message of the given level would be logged by this logger.

Parameters
level:System.Logger.Level

the log message level.

Returns:boolean

true if the given log message level is currently being logged.

Annotations
@Override
isLoggableback to summary
public boolean isLoggable(PlatformLogger.Level level)

Returns true if a message of the given level would actually be logged by this logger.

Parameters
level:PlatformLogger.Level

the level

Returns:boolean

whether a message of that level would be logged

logback to summary
public void log(System.Logger.Level level, ResourceBundle bundle, String format, Object... params)

Implements java.lang.System.Logger.log.

Doc from java.lang.System.Logger.log.

Logs a message with resource bundle and an optional list of parameters. If the given resource bundle is non-null, the format string is localized using the given resource bundle. Otherwise the format string is not localized.

Parameters
level:System.Logger.Level

the log message level.

bundle:ResourceBundle

a resource bundle to localize format; can be null.

format:String

the string message format in java.text.MessageFormat format, (or a key in the message catalog if bundle is not null); can be null.

params:Object[]

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

Annotations
@Override
logback to summary
public void log(System.Logger.Level level, ResourceBundle bundle, String msg, Throwable thrown)

Implements java.lang.System.Logger.log.

Doc from java.lang.System.Logger.log.

Logs a localized message associated with a given throwable. If the given resource bundle is non-null, the msg string is localized using the given resource bundle. Otherwise the msg string is not localized.

Parameters
level:System.Logger.Level

the log message level.

bundle:ResourceBundle

a resource bundle to localize msg; can be null.

msg:String

the string message (or a key in the message catalog, if bundle is not null); can be null.

thrown:Throwable

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

Annotations
@Override
severeback to summary
public void severe(String msg)

Logs a SEVERE message.

Parameters
msg:String

the message

severeback to summary
public void severe(String msg, Throwable t)
severeback to summary
public void severe(String msg, Object... params)
warningback to summary
public void warning(String msg)

Logs a WARNING message.

Parameters
msg:String

the message

warningback to summary
public void warning(String msg, Throwable t)
warningback to summary
public void warning(String msg, Object... params)
com.sun.javafx.logging back to summary

public final Enum PlatformLogger.Level

extends Enum<PlatformLogger.Level>
Class Inheritance

PlatformLogger logging levels.

Field Summary

Modifier and TypeField and Description
public static final PlatformLogger.Level
public static final PlatformLogger.Level
public static final PlatformLogger.Level
public static final PlatformLogger.Level
public static final PlatformLogger.Level
public static final PlatformLogger.Level
public static final PlatformLogger.Level
pack-priv final System.Logger.Level
public static final PlatformLogger.Level

Constructor Summary

AccessConstructor and Description
private
Level(System.Logger.Level systemLevel)

Method Summary

Modifier and TypeMethod and Description
public static PlatformLogger.Level
public static PlatformLogger.Level[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

ALLback to summary
public static final PlatformLogger.Level ALL
FINEback to summary
public static final PlatformLogger.Level FINE
FINERback to summary
public static final PlatformLogger.Level FINER
FINESTback to summary
public static final PlatformLogger.Level FINEST
INFOback to summary
public static final PlatformLogger.Level INFO
OFFback to summary
public static final PlatformLogger.Level OFF
SEVEREback to summary
public static final PlatformLogger.Level SEVERE
systemLevelback to summary
pack-priv final System.Logger.Level systemLevel
WARNINGback to summary
public static final PlatformLogger.Level WARNING

Constructor Detail

Levelback to summary
private Level(System.Logger.Level systemLevel)

Method Detail

valueOfback to summary
public static PlatformLogger.Level valueOf(String name)
valuesback to summary
public static PlatformLogger.Level[] values()