Contents
- Description
- Nested Class Summary
- Field Summary
- Method Summary
- Field Details
- Method Details
- getLoggerName()
- getLevel()
- isLoggable(Level)
- log(LogData)
- handleError(RuntimeException, LogData)
- log(LogRecord)
- log(LogRecord, boolean)
- subscribe(CopyOnWriteArrayList)
- unsubscribe(CopyOnWriteArrayList)
- getSubLogger(String)
- setSentryClient(IScopes)
- setPropagatesSentryToParent(boolean)
- setOnLevelChange(BiConsumer)
- setLevel(Level)
- loadLogLevel()
- loadLevels(List)
- reloadLogLevels()
- getLogger()
- getLogger(String)
- getLogger(String, BiConsumer)
- setIndent(int)
- isJunitTest()
- rawLog(String)
Class HytaleLoggerBackend
java.lang.Object
com.google.common.flogger.backend.LoggerBackend
com.hypixel.hytale.logger.backend.HytaleLoggerBackend
public class HytaleLoggerBackend
extends com.google.common.flogger.backend.LoggerBackend
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiongetLevel()static HytaleLoggerBackendGets the root HytaleLoggerBackend for general purpose logging.static HytaleLoggerBackendGets the HytaleLoggerBackend under the provided name, creating it if necessary.static HytaleLoggerBackendgetLogger(String name, BiConsumer<Level, Level> onLevelChange) Gets the HytaleLoggerBackend under the provided name, creating it if necessary.getSubLogger(String name) voidhandleError(RuntimeException error, com.google.common.flogger.backend.LogData badData) static booleanbooleanisLoggable(Level lvl) static voidloadLevels(List<Map.Entry<String, Level>> list) voidvoidlog(com.google.common.flogger.backend.LogData data) voidvoidstatic voidstatic voidstatic voidsetIndent(int indent) voidvoidsetOnLevelChange(BiConsumer<Level, Level> onLevelChange) voidsetPropagatesSentryToParent(boolean propagate) Sets whether exceptions logged to this logger should propagate to parent Sentry handlers.voidsetSentryClient(io.sentry.IScopes scope) static voidsubscribe(CopyOnWriteArrayList<LogRecord> subscriber) static voidunsubscribe(CopyOnWriteArrayList<LogRecord> subscriber)
-
Field Details
-
LOG_LEVEL_LOADER
-
REAL_SOUT
-
REAL_SERR
-
-
Method Details
-
getLoggerName
- Specified by:
getLoggerNamein classcom.google.common.flogger.backend.LoggerBackend
-
getLevel
-
isLoggable
- Specified by:
isLoggablein classcom.google.common.flogger.backend.LoggerBackend
-
log
public void log(@Nonnull com.google.common.flogger.backend.LogData data) - Specified by:
login classcom.google.common.flogger.backend.LoggerBackend
-
handleError
public void handleError(@Nonnull RuntimeException error, @Nonnull com.google.common.flogger.backend.LogData badData) - Specified by:
handleErrorin classcom.google.common.flogger.backend.LoggerBackend
-
log
-
log
-
subscribe
-
unsubscribe
-
getSubLogger
-
setSentryClient
public void setSentryClient(@Nullable io.sentry.IScopes scope) -
setPropagatesSentryToParent
public void setPropagatesSentryToParent(boolean propagate) Sets whether exceptions logged to this logger should propagate to parent Sentry handlers. When false, exceptions will still be logged to file/console but won't be sent to parent Sentry handlers (e.g., the root logger's Sentry). This logger's own Sentry handler (if set) will still receive exceptions.- Parameters:
propagate- true to propagate to parent Sentry handlers (default), false to block
-
setOnLevelChange
-
setLevel
-
loadLogLevel
public void loadLogLevel() -
loadLevels
-
reloadLogLevels
public static void reloadLogLevels() -
getLogger
Gets the root HytaleLoggerBackend for general purpose logging. Try to avoid using this and instead get your own more granular logger when possible.- Returns:
- The root HytaleLoggerBackend
-
getLogger
Gets the HytaleLoggerBackend under the provided name, creating it if necessary. If loadLogLevel is true, we will load the log level of this logger from the OptionSet.- Parameters:
name- The name of the logger to fetch- Returns:
- The logger, freshly created if not existing, otherwise fetched from the cache.
-
getLogger
@Nonnull public static HytaleLoggerBackend getLogger(String name, BiConsumer<Level, Level> onLevelChange) Gets the HytaleLoggerBackend under the provided name, creating it if necessary. If loadLogLevel is true, we will load the log level of this logger from the OptionSet. The onLevelChange consumer will be fired if the log level is changed.- Parameters:
name- The name of the logger to fetchonLevelChange- A callback to fire whenever this logger's setLevel() is called.- Returns:
- The logger, freshly created if not existing, otherwise fetched from the cache.
-
setIndent
public static void setIndent(int indent) -
isJunitTest
public static boolean isJunitTest() -
rawLog
-