public final class RuntimeProvider extends Object
Modifier and Type | Method and Description |
---|---|
static Timestamp |
createTimestamp()
Creates a timestamp with the current date and time.
|
static TimestampFormatter |
createTimestampFormatter(String pattern,
Locale locale)
Creates a formatter for
Timestamps . |
static String |
getCallerClassName(int depth)
Gets the class name of a caller from stack trace.
|
static String |
getCallerClassName(String loggerClassName)
Gets the class name of a caller from stack trace.
|
static StackTraceElement |
getCallerStackTraceElement(int depth)
Gets the complete stack trace element of a caller from stack trace.
|
static StackTraceElement |
getCallerStackTraceElement(String loggerClassName)
Gets the complete stack trace element of a caller from stack trace.
|
static List<ClassLoader> |
getClassLoaders()
Gets valid and available class loaders.
|
static String |
getDefaultWriter()
Gets the name of the default writer.
|
static long |
getProcessId()
Gets the ID of the current process (pid).
|
static Timestamp |
getStartTime()
Gets the start time of the Java virtual machine or tinylog.
|
static boolean |
isAndroid()
Checks if running on Android.
|
public static boolean isAndroid()
true
if running on Android, otherwise false
public static List<ClassLoader> getClassLoaders()
public static String getDefaultWriter()
public static long getProcessId()
public static Timestamp getStartTime()
public static String getCallerClassName(int depth)
depth
- Position of caller in stack tracepublic static String getCallerClassName(String loggerClassName)
loggerClassName
- Logger class name that should appear before the real callerpublic static StackTraceElement getCallerStackTraceElement(int depth)
depth
- Position of caller in stack tracepublic static StackTraceElement getCallerStackTraceElement(String loggerClassName)
loggerClassName
- Logger class name that should appear before the real callerpublic static Timestamp createTimestamp()
public static TimestampFormatter createTimestampFormatter(String pattern, Locale locale)
Timestamps
.pattern
- Format pattern that is compatible with DateTimeFormatter
locale
- Locale for formattingCopyright © 2024. All rights reserved.