Package com.petarmc.lib.log
Class Log
java.lang.Object
com.petarmc.lib.log.Log
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic PLoggerReturns a logger instance for the specified class.static PLoggerReturns a logger instance with the specified name.static voidInjects a custom logger to be returned by allget(java.lang.Class<?>)calls.
-
Field Details
-
injected
-
-
Constructor Details
-
Log
public Log()
-
-
Method Details
-
inject
Injects a custom logger to be returned by allget(java.lang.Class<?>)calls.- Parameters:
logger- the logger to inject
-
get
Returns a logger instance for the specified class. If a logger has been injected viainject(com.petarmc.lib.log.PLogger), it returns the injected logger. Otherwise, it returns a newPLognamed after the class.- Parameters:
clazz- the class for which the logger is requested- Returns:
- a logger instance
-
get
Returns a logger instance with the specified name. If a logger has been injected viainject(com.petarmc.lib.log.PLogger), it returns the injected logger. Otherwise, it returns a newPLogwith the given name.- Parameters:
name- the name of the logger- Returns:
- a logger instance
-