forked from StarOpenSource/Engine
Make EngineConfiguration a bit safer
This commit is contained in:
parent
0031c4ef29
commit
f9d5a4e124
2 changed files with 6 additions and 1 deletions
|
@ -47,7 +47,7 @@ public final class EngineConfiguration implements SubsystemConfiguration {
|
|||
* -- GETTER --
|
||||
* Returns the {@link EngineConfiguration} instance.
|
||||
*
|
||||
* @return {@link EngineConfiguration} instance
|
||||
* @return {@link EngineConfiguration} instance unless {@link Engine} is uninitialized
|
||||
* @since 1-alpha0
|
||||
*/
|
||||
@Getter
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
|
||||
package de.staropensource.sosengine.base.logging;
|
||||
|
||||
import de.staropensource.sosengine.base.Engine;
|
||||
import de.staropensource.sosengine.base.EngineConfiguration;
|
||||
import de.staropensource.sosengine.base.classes.LoggerImpl;
|
||||
import de.staropensource.sosengine.base.classes.Placeholder;
|
||||
|
@ -85,6 +86,10 @@ public final class Logger {
|
|||
* @since 1-alpha0
|
||||
*/
|
||||
private static void log(@NotNull LogLevel level, @NotNull LogIssuer logIssuer, @NotNull String message) {
|
||||
// Check if engine has initialized
|
||||
|
||||
if (Engine.getInstance() == null) return;
|
||||
|
||||
// Check if level is allowed
|
||||
if (level.compareTo(EngineConfiguration.getInstance().getLoggerLevel()) < 0)
|
||||
return;
|
||||
|
|
Loading…
Reference in a new issue