forked from johncfranco/reactive-logger
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove old packages and can be configuration default values
- Loading branch information
Showing
28 changed files
with
126 additions
and
2,509 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
84 changes: 84 additions & 0 deletions
84
src/main/java/io/github/numichi/reactive/logger/DefaultValues.java
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,84 @@ | ||
package io.github.numichi.reactive.logger; | ||
|
||
import io.github.numichi.reactive.logger.annotations.JacocoSkipGeneratedReport; | ||
import io.github.numichi.reactive.logger.exception.AlreadyConfigurationException; | ||
import reactor.core.scheduler.Scheduler; | ||
import reactor.core.scheduler.Schedulers; | ||
|
||
@JacocoSkipGeneratedReport | ||
public class DefaultValues { | ||
private static final String DEFAULT_REACTOR_CONTEXT_MDC_KEY = "EFAULT_REACTOR_CONTEXT_MDC_KEY"; | ||
private static final Scheduler DEFAULT_SCHEDULER = Schedulers.boundedElastic(); | ||
private static DefaultValues instance = null; | ||
private final String defaultReactorContextMdcKey; | ||
private final Scheduler defaultScheduler; | ||
|
||
private DefaultValues() { | ||
this(DEFAULT_REACTOR_CONTEXT_MDC_KEY, DEFAULT_SCHEDULER); | ||
} | ||
|
||
private DefaultValues(Scheduler defaultScheduler) { | ||
this(DEFAULT_REACTOR_CONTEXT_MDC_KEY, defaultScheduler); | ||
} | ||
|
||
private DefaultValues(String defaultReactorContextMdcKey) { | ||
this(defaultReactorContextMdcKey, DEFAULT_SCHEDULER); | ||
} | ||
|
||
private DefaultValues(String defaultReactorContextMdcKey, Scheduler defaultScheduler) { | ||
this.defaultReactorContextMdcKey = defaultReactorContextMdcKey; | ||
this.defaultScheduler = defaultScheduler; | ||
} | ||
|
||
public static DefaultValues getInstance() { | ||
if (instance == null) { | ||
instance = configuration(); | ||
} | ||
|
||
return instance; | ||
} | ||
|
||
public static DefaultValues configuration() throws AlreadyConfigurationException { | ||
if (instance == null) { | ||
instance = new DefaultValues(); | ||
return instance; | ||
} else { | ||
throw new AlreadyConfigurationException(); | ||
} | ||
} | ||
|
||
public static DefaultValues configuration(Scheduler defaultScheduler) throws AlreadyConfigurationException { | ||
if (instance == null) { | ||
instance = new DefaultValues(defaultScheduler); | ||
return instance; | ||
} else { | ||
throw new AlreadyConfigurationException(); | ||
} | ||
} | ||
|
||
public static DefaultValues configuration(String defaultReactorContextMdcKey) throws AlreadyConfigurationException { | ||
if (instance == null) { | ||
instance = new DefaultValues(defaultReactorContextMdcKey); | ||
return instance; | ||
} else { | ||
throw new AlreadyConfigurationException(); | ||
} | ||
} | ||
|
||
public static DefaultValues configuration(String defaultReactorContextMdcKey, Scheduler defaultScheduler) throws AlreadyConfigurationException { | ||
if (instance == null) { | ||
instance = new DefaultValues(defaultReactorContextMdcKey, defaultScheduler); | ||
return instance; | ||
} else { | ||
throw new AlreadyConfigurationException(); | ||
} | ||
} | ||
|
||
public String getDefaultReactorContextMdcKey() { | ||
return defaultReactorContextMdcKey; | ||
} | ||
|
||
public Scheduler getDefaultScheduler() { | ||
return defaultScheduler; | ||
} | ||
} |
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
11 changes: 0 additions & 11 deletions
11
src/main/java/io/github/numichi/reactive/logger/Values.java
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
6 changes: 3 additions & 3 deletions
6
src/main/java/io/github/numichi/reactive/logger/coroutine/readMDC.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
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
7 changes: 7 additions & 0 deletions
7
src/main/java/io/github/numichi/reactive/logger/exception/AlreadyConfigurationException.java
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,7 @@ | ||
package io.github.numichi.reactive.logger.exception; | ||
|
||
public class AlreadyConfigurationException extends RuntimeException { | ||
public AlreadyConfigurationException() { | ||
super("DefaultValues have already configurated!"); | ||
} | ||
} |
81 changes: 0 additions & 81 deletions
81
src/main/java/io/github/numichi/reactive/logger/java/MDCContext.java
This file was deleted.
Oops, something went wrong.
40 changes: 0 additions & 40 deletions
40
src/main/java/io/github/numichi/reactive/logger/java/MDCSnapshot.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.