Top Fields Constructors Methods
org.apache.sshd.common.util.logging

public final Class LoggingUtils

extends Object
Class Inheritance
Imports
java.lang.reflect.Field, .Modifier, java.util.ArrayList, .Collection, .Collections, .Comparator, .EnumSet, .List, .Map, .NavigableMap, .Objects, .Set, .TreeMap, java.util.function.Consumer, .Predicate, java.util.logging.Level, org.apache.sshd.common.util.GenericUtils, .NumberUtils, .ReflectionUtils, org.slf4j.Logger, org.slf4j.helpers.FormattingTuple, .MessageFormatter

Author
Apache MINA SSHD Project

Field Summary

Modifier and TypeField and Description
public static final Set<Level>

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static void
debug(Logger log, String message, Object o1, Object o2, Throwable t)

public static void
debug(Logger log, String message, Object o1, Object o2, Object o3, Throwable t)

public static void
debug(Logger log, String message, Object o1, Object o2, Object o3, Object o4, Throwable t)

public static void
debug(Logger log, String message, Object o1, Object o2, Object o3, Object o4, Object o5, Throwable t)

public static void
debug(Logger log, String message, Object o1, Object o2, Object o3, Object o4, Object o5, Object o6, Throwable t)

public static <
Generic message type consumer
T
>
Consumer<T>

Returns:

A consumer whose Consumer#accept(Object) method logs the String#valueOf(Object) value of its argument if Logger#isDebugEnabled()
debugClosure
(Logger
The Logger instance to use
logger
)

public static <
Generic message type consumer
T
>
Consumer<T>

Returns:

A consumer whose Consumer#accept(Object) method logs the String#valueOf(Object) value of its argument if Logger#isDebugEnabled()
debugClosure
(Logger
The Logger instance to use
logger
,
Throwable
A Throwable to attach to the message - ignored if null
thrown
)

public static void
error(Logger log, String message, Object o1, Object o2, Throwable t)

public static void
error(Logger log, String message, Object o1, Object o2, Object o3, Throwable t)

public static void
error(Logger log, String message, Object o1, Object o2, Object o3, Object o4, Throwable t)

public static void
error(Logger log, String message, Object o1, Object o2, Object o3, Object o4, Object o5, Throwable t)

public static void
error(Logger log, String message, Object o1, Object o2, Object o3, Object o4, Object o5, Object o6, Throwable t)

public static <
Generic message type consumer
T
>
Consumer<T>

Returns:

A consumer whose Consumer#accept(Object) method logs the String#valueOf(Object) value of its argument if Logger#isErrorEnabled()
errorClosure
(Logger
The Logger instance to use
logger
)

public static <
Generic message type consumer
T
>
Consumer<T>

Returns:

A consumer whose Consumer#accept(Object) method logs the String#valueOf(Object) value of its argument if Logger#isErrorEnabled()
errorClosure
(Logger
The Logger instance to use
logger
,
Throwable
A Throwable to attach to the message - ignored if null
thrown
)

public static String

Returns:

The formatted message - or the format itself if no arguments or no format string
formatMessage
(String
The formatting instructions - ignored if null/empty
format
,
Object...
The formatting arguments - ignored if null/empty
arguments
)

Formats an slf4j message using its formatting structure - mainly the usage of positional arguments - e.g., "Value1={}, Value2={}, ...

public static NavigableMap<Integer, String>

Returns:

A NavigableMap of all the matching fields, where key=the field's Integer value and mapping=the field's name
generateMnemonicMap
(Class<?>
The Class to query
clazz
,
final String
The expected common prefix
commonPrefix
)

Scans using reflection API for all fields that are public static final that start with the given common prefix (case sensitive) and are of type Number.

public static NavigableMap<Integer, String>

Returns:

A NavigableMap of all the matching fields, where key=the field's Integer value and mapping=the field's name
generateMnemonicMap
(Class<?>
The Class to query
clazz
,
Predicate<? super Field>
The Predicate used to decide whether to process the Field (besides being a Number and public static final).
acceptor
)

Scans using reflection API for all numeric public static final fields that are also accepted by the predicate.

public static Map<String, Integer>

Returns:

A Map of all the mnemonic fields names whose value is the same as other fields in this map. The key is the field's name and value is its associated opcode.
getAmbiguousMenmonics
(Class<?>
The Class to query
clazz
,
String
The expected common prefix
commonPrefix
)

Scans using reflection API for all numeric public static final fields that have a common prefix and whose value is used by several of the other matching fields

public static Map<String, Integer>

Returns:

A Map of all the mnemonic fields names whose value is the same as other fields in this map. The key is the field's name and value is its associated opcode.
getAmbiguousMenmonics
(Class<?>
The Class to query
clazz
,
Predicate<? super Field>
The Predicate used to decide whether to process the Field (besides being a Number and public static final).
acceptor
)

Scans using reflection API for all numeric public static final fields that are also accepted by the predicate and whose value is used by several of the other matching fields

public static Collection<Field>

Returns:

A Collection of all the fields that have satisfied all conditions
getMnemonicFields
(Class<?>
The Class to query
clazz
,
Predicate<? super Field>
The Predicate used to decide whether to process the Field (besides being a Number and public static final).
acceptor
)

Scans using reflection API for all numeric public static final fields that are also accepted by the predicate.

public static void
info(Logger log, String message, Object o1, Object o2, Throwable t)

public static void
info(Logger log, String message, Object o1, Object o2, Object o3, Throwable t)

public static <
Generic message type consumer
T
>
Consumer<T>

Returns:

A consumer whose Consumer#accept(Object) method logs the String#valueOf(Object) value of its argument if Logger#isInfoEnabled()
infoClosure
(Logger
The Logger instance to use
logger
)

public static <
Generic message type consumer
T
>
Consumer<T>

Returns:

A consumer whose Consumer#accept(Object) method logs the String#valueOf(Object) value of its argument if Logger#isInfoEnabled()
infoClosure
(Logger
The Logger instance to use
logger
,
Throwable
A Throwable to attach to the message - ignored if null
thrown
)

public static boolean

Returns:

true if the level is enabled for the logger. The mapping of the level to the logger is as follows:
isLoggable
(Logger
The Logger instance - ignored if null
logger
,
Level
The validate log Level - ignored if null
level
)

public static <
Generic message type consumer
T
>
Consumer<T>

Returns:

A consumer whose Consumer#accept(Object) method logs the String#valueOf(Object) value of its argument if the specific level is enabled
loggingClosure
(Logger
The Logger instance to use
logger
,
Level level)

public static <T> Consumer<T>
public static void
logMessage(Logger logger, Level level, Object message, Throwable t)

public static <
Generic message type consumer
T
>
Consumer<T>

Returns:

A consumer whose Consumer#accept(Object) method logs nothing when invoked
nologClosure
(Logger
The Logger instance to use
logger
)

public static Level
public static <
Generic message type consumer
T
>
Consumer<T>

Returns:

A consumer whose Consumer#accept(Object) method logs the String#valueOf(Object) value of its argument if Logger#isTraceEnabled()
traceClosure
(Logger
The Logger instance to use
logger
)

public static <
Generic message type consumer
T
>
Consumer<T>

Returns:

A consumer whose Consumer#accept(Object) method logs the String#valueOf(Object) value of its argument if Logger#isTraceEnabled()
traceClosure
(Logger
The Logger instance to use
logger
,
Throwable
A Throwable to attach to the message - ignored if null
thrown
)

public static void
warn(Logger log, String message, Object o1, Object o2, Throwable t)

public static void
warn(Logger log, String message, Object o1, Object o2, Object o3, Throwable t)

public static void
warn(Logger log, String message, Object o1, Object o2, Object o3, Object o4, Throwable t)

public static void
warn(Logger log, String message, Object o1, Object o2, Object o3, Object o4, Object o5, Throwable t)

public static void
warn(Logger log, String message, Object o1, Object o2, Object o3, Object o4, Object o5, Object o6, Throwable t)

public static void
warn(Logger log, String message, Object o1, Object o2, Object o3, Object o4, Object o5, Object o6, Object o7, Throwable t)

public static void
warn(Logger log, String message, Object o1, Object o2, Object o3, Object o4, Object o5, Object o6, Object o7, Object o8, Throwable t)

public static void
warn(Logger log, String message, Object o1, Object o2, Object o3, Object o4, Object o5, Object o6, Object o7, Object o8, Object o9, Throwable t)

public static <
Generic message type consumer
T
>
Consumer<T>

Returns:

A consumer whose Consumer#accept(Object) method logs the String#valueOf(Object) value of its argument if Logger#isWarnEnabled()
warnClosure
(Logger
The Logger instance to use
logger
)

public static <
Generic message type consumer
T
>
Consumer<T>

Returns:

A consumer whose Consumer#accept(Object) method logs the String#valueOf(Object) value of its argument if Logger#isWarnEnabled()
warnClosure
(Logger
The Logger instance to use
logger
,
Throwable
A Throwable to attach to the message - ignored if null
thrown
)

public static SimplifiedLog
wrap(Logger logger)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait