mirror of
https://github.com/alexcrea/CustomAnvil.git
synced 2026-08-28 08:25:56 +02:00
This commit is contained in:
parent
fcbe6ba3fb
commit
965ee33325
5 changed files with 140 additions and 2 deletions
|
|
@ -71,21 +71,35 @@ open class CustomAnvil : JavaPlugin() {
|
|||
|
||||
var latestVer: String? = null
|
||||
|
||||
// Debug
|
||||
val debugStorageQueue = ArrayDeque<String>()
|
||||
|
||||
private fun addToLogQueue(message: String) {
|
||||
if(debugStorageQueue.size >= 200) {
|
||||
// Let not store infinite debug logs lol
|
||||
debugStorageQueue.removeFirst()
|
||||
}
|
||||
|
||||
debugStorageQueue.addLast(message)
|
||||
}
|
||||
|
||||
/**
|
||||
* Logging handler
|
||||
*/
|
||||
@JvmStatic fun log(message: String) {
|
||||
if (ConfigOptions.debugLog) {
|
||||
instance.logger.info(message)
|
||||
addToLogQueue(message)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Vebose Logging handler
|
||||
*/
|
||||
fun verboseLog(message: String) {
|
||||
@JvmStatic fun verboseLog(message: String) {
|
||||
if (ConfigOptions.verboseDebugLog) {
|
||||
instance.logger.info(message)
|
||||
addToLogQueue(message)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue