feat(logger): support configuration entrypoint
ci/woodpecker/push/woodpecker Pipeline was successful
Details
ci/woodpecker/push/woodpecker Pipeline was successful
Details
This commit is contained in:
parent
65b25e85b3
commit
e38bb73f7c
|
@ -4,6 +4,7 @@ import io.gitlab.jfronny.commons.ref.WeakSet;
|
|||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.ServiceLoader;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
|
@ -55,6 +56,10 @@ public class HotswapLoggerFinder extends LeveledLoggerFinder {
|
|||
}
|
||||
}
|
||||
|
||||
static {
|
||||
ServiceLoader.load(LoggerConfiguration.class).forEach(LoggerConfiguration::configure);
|
||||
}
|
||||
|
||||
public HotswapLoggerFinder() {
|
||||
KNOWN_INSTANCES.add(this);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
package io.gitlab.jfronny.commons.logger;
|
||||
|
||||
/**
|
||||
* Run using the ServiceLoader mechanism when HotswapLoggerFinder is first used.
|
||||
*/
|
||||
public interface LoggerConfiguration {
|
||||
void configure();
|
||||
}
|
|
@ -1,4 +1,5 @@
|
|||
module io.gitlab.jfronny.commons.logger {
|
||||
uses io.gitlab.jfronny.commons.logger.LoggerConfiguration;
|
||||
requires io.gitlab.jfronny.commons;
|
||||
requires static org.jetbrains.annotations;
|
||||
exports io.gitlab.jfronny.commons.logger;
|
||||
|
|
Loading…
Reference in New Issue