Package com.petarmc.lib.log
Class PLog
java.lang.Object
com.petarmc.lib.log.PLog
- All Implemented Interfaces:
PLogger
PerformanceLog implementation that logs messages to the console and optionally to a file.
Designed to track debug, info, warning, and error messages with optional thread information.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate booleanvoidLogs a debug-level message.voidLogs an error-level message.voidLogs an error-level message along with a Throwable.private StringgetName()Returns the name of this logger.voidLogs an info-level message.voidLogs a warning-level message.private voidwriteToFile(String line)
-
Field Details
-
name
-
prefix
-
-
Constructor Details
-
PLog
Creates a new PerformanceLog instance with the given name.- Parameters:
name- the name of the logger, typically representing the class or module
-
-
Method Details
-
getName
Returns the name of this logger. -
format
-
writeToFile
-
allowed
-
debug
Logs a debug-level message. -
info
Logs an info-level message. Ignored ifLogConfig.enforceLevelis true and the global log level is higher than INFO. -
warn
Logs a warning-level message. -
error
Logs an error-level message. -
error
Logs an error-level message along with a Throwable. Prints the exception's stack trace and message.
-