Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion core/main/java/com/codingchili/core/logging/LogMessage.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

import io.vertx.core.json.JsonObject;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

import static com.codingchili.core.configuration.CoreStrings.*;

/**
Expand All @@ -10,6 +13,7 @@
public class LogMessage {
private Logger logger;
private JsonObject event;
private final ExecutorService executor = Executors.newSingleThreadExecutor();

/**
* Creates a new logging message. Constructor typically invoked indirectly
Expand Down Expand Up @@ -50,7 +54,9 @@ public LogMessage put(String key, Object value) {
* @return the logger that was used to send the message.
*/
public Logger send() {
logger.log(event);
executor.execute(() -> {
logger.log(event);
});
return logger;
}

Expand Down