-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from EraTiem-Network/next
1.0.0.alpha1
- Loading branch information
Showing
17 changed files
with
72 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
bungeecord/src/main/kotlin/net/eratiem/eralogger/EraLoggerPlugin.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package net.eratiem.eralogger | ||
|
||
import net.md_5.bungee.api.plugin.Plugin | ||
|
||
class EraLoggerPlugin : Plugin() { | ||
override fun onEnable() { | ||
logger.info("EraLogger can now be used!") | ||
} | ||
|
||
override fun onDisable() { | ||
logger.info("EraLogger disabled!") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
plugins { | ||
// alias(libs.plugins.run.paper) | ||
} | ||
|
||
dependencies { | ||
compileOnly(libs.minecraft.server.folia) | ||
} | ||
|
||
//tasks.runServer { | ||
// minecraftVersion("1.19.4") | ||
//} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
tools/src/main/kotlin/net/eratiem/eralogger/EraFormatter.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package net.eratiem.eralogger | ||
|
||
import java.util.logging.Formatter | ||
import java.util.logging.LogRecord | ||
|
||
internal class EraFormatter : Formatter() { | ||
override fun format(record: LogRecord?): String { | ||
return "TEST" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package net.eratiem.eralogger | ||
|
||
import java.util.logging.Handler | ||
import java.util.logging.LogRecord | ||
|
||
internal class EraHandler : Handler() { | ||
|
||
init { | ||
formatter = EraFormatter() | ||
} | ||
|
||
override fun publish(record: LogRecord?) { | ||
println("EraLogger: ${record?.message}") | ||
} | ||
|
||
override fun flush() {} | ||
|
||
override fun close() {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,8 @@ | ||
package net.eratiem.eralogger | ||
|
||
import org.slf4j.Logger | ||
import java.util.logging.Logger as JLogger | ||
import java.util.logging.Logger | ||
|
||
interface EraLogger { | ||
companion object { | ||
private val instances: LinkedHashMap<String, EraLogger> = linkedMapOf() | ||
|
||
fun getInstance(plugin: String, logger: JLogger): EraLogger = | ||
instances.getOrPut(plugin) { EraLoggerImpl(logger as Logger) } | ||
|
||
fun destroyInstance(plugin: String): Boolean = | ||
instances.remove(plugin) == null | ||
} | ||
|
||
var debug: Boolean | ||
fun debug(msg: String) | ||
fun info(msg: String) | ||
fun warning(msg: String) | ||
fun error(msg: String) | ||
fun error(msg: String, err: Throwable) | ||
fun severe(msg: String) | ||
fun severe(msg: String, err: Throwable) | ||
|
||
private class EraLoggerImpl( | ||
private val logger: Logger, | ||
override var debug: Boolean = false | ||
) : EraLogger { | ||
override fun debug(msg: String) { | ||
if (debug) | ||
logger.info("DEBUG: $msg") | ||
} | ||
|
||
override fun info(msg: String) { | ||
logger.info(msg) | ||
} | ||
|
||
override fun warning(msg: String) { | ||
logger.warn(msg) | ||
} | ||
|
||
override fun error(msg: String) { | ||
logger.error(msg) | ||
} | ||
|
||
override fun error(msg: String, err: Throwable) { | ||
logger.error(msg, err) | ||
} | ||
|
||
override fun severe(msg: String) { | ||
logger.error(msg) | ||
} | ||
|
||
override fun severe(msg: String, err: Throwable) { | ||
logger.error(msg, err) | ||
} | ||
|
||
} | ||
fun Logger.addToEraLogger() { | ||
addHandler(EraHandler()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters