Fix PlaceholderEngine usage in Logger.java
All checks were successful
build-and-test / test (push) Successful in 2m22s
build-and-test / build (push) Successful in 2m29s
build-and-test / generate-javadoc (push) Successful in 2m27s

This commit is contained in:
JeremyStar™ 2024-08-20 22:32:21 +02:00
parent 98ff132d27
commit 5718f33d88
Signed by: JeremyStarTM
GPG key ID: E366BAEF67E4704D
2 changed files with 5 additions and 5 deletions

View file

@ -200,10 +200,7 @@ public final class Logger {
if (format == null)
format = EngineConfiguration.getInstance().getLoggerTemplate();
// Replace placeholders
// Using PlaceholderEngine
format = PlaceholderEngine.getInstance().process(format);
// Logger placeholders (no colors)
// Replace logger placeholders (no colors)
format = new LogClass(issuerClass).replace(format);
format = new de.staropensource.sosengine.base.internal.placeholders.logger.LogLevel(level).replace(format);
format = new LogMetadata(issuerMetadata).replace(format);
@ -259,6 +256,9 @@ public final class Logger {
format = new LogColorPrimary(level).replace(format);
format = new LogColorSecondary(level).replace(format);
// Replace placeholders using PlaceholderEngine
format = PlaceholderEngine.getInstance().process(format);
// Invoke LoggerImpl#postPlaceholder
format = loggerImplementation.postPlaceholder(level, issuerClass, issuerOrigin, issuerMetadata, message, format);

View file

@ -142,7 +142,7 @@ public final class PlaceholderEngine {
* @return the processed text
* @since v1-alpha0
*/
public @NotNull String process(@NotNull String text, List<@NotNull Placeholder> temporaryPlaceholders) {
public @NotNull String process(@NotNull String text, @NotNull List<@NotNull Placeholder> temporaryPlaceholders) {
// Process temporary placeholders
for (Placeholder temporaryPlaceholder : temporaryPlaceholders)
text = temporaryPlaceholder.replace(text);