LogSites

public final class LogSites

Helper class to generate log sites for the current line of code. This class is deliberately isolated (rather than having the method in LogSite itself) because manual log site injection is rare and by isolating it into a separate class may help encourage users to think carefully about the issue.

Functions

Link copied to clipboard
public static LogSite callerOf(Class<? extends Object> loggingApi)
Returns a LogSite for the caller of the specified class.
Link copied to clipboard
public static LogSite logSite()
Returns a LogSite for the current line of code.
Link copied to clipboard
public static LogSite logSiteFrom(@Nullable() @Nullable() StackTraceElement e)
Returns a new LogSite which reflects the information in the given , or INVALID if given null.