Search in sources :

Example 1 with LogManager

use of core.framework.impl.log.LogManager in project core-ng-project by neowu.

the class ActionLogContext method track.

public static void track(String action, long elapsedTime, Integer readEntries, Integer writeEntries) {
    LogManager logManager = logManager();
    ActionLog actionLog = logManager.currentActionLog();
    if (actionLog != null) {
        actionLog.track(action, elapsedTime, readEntries, writeEntries);
    }
}
Also used : LogManager(core.framework.impl.log.LogManager) ActionLog(core.framework.impl.log.ActionLog)

Example 2 with LogManager

use of core.framework.impl.log.LogManager in project core-ng-project by neowu.

the class ActionLogContext method put.

public static void put(String key, Object value) {
    LogManager logManager = logManager();
    ActionLog actionLog = logManager.currentActionLog();
    if (actionLog != null) {
        // here to check null is for unit testing the logManager.begin may not be called
        actionLog.context(key, value);
    }
}
Also used : LogManager(core.framework.impl.log.LogManager) ActionLog(core.framework.impl.log.ActionLog)

Example 3 with LogManager

use of core.framework.impl.log.LogManager in project core-ng-project by neowu.

the class ActionLogContext method id.

public static String id() {
    LogManager logManager = logManager();
    ActionLog actionLog = logManager.currentActionLog();
    if (actionLog == null)
        return null;
    return actionLog.id;
}
Also used : LogManager(core.framework.impl.log.LogManager) ActionLog(core.framework.impl.log.ActionLog)

Example 4 with LogManager

use of core.framework.impl.log.LogManager in project core-ng-project by neowu.

the class KafkaMessagePublisherTest method createMessagePublisher.

@BeforeEach
void createMessagePublisher() {
    producer = new MockProducer<>(true, new StringSerializer(), new ByteArraySerializer());
    logManager = new LogManager();
    messagePublisher = new KafkaMessagePublisher<>(producer, "topic", TestMessage.class, logManager);
}
Also used : StringSerializer(org.apache.kafka.common.serialization.StringSerializer) ByteArraySerializer(org.apache.kafka.common.serialization.ByteArraySerializer) LogManager(core.framework.impl.log.LogManager) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 5 with LogManager

use of core.framework.impl.log.LogManager in project core-ng-project by neowu.

the class ActionLogContext method get.

public static Optional<String> get(String key) {
    LogManager logManager = logManager();
    ActionLog actionLog = logManager.currentActionLog();
    if (actionLog == null)
        return Optional.empty();
    return actionLog.context(key);
}
Also used : LogManager(core.framework.impl.log.LogManager) ActionLog(core.framework.impl.log.ActionLog)

Aggregations

LogManager (core.framework.impl.log.LogManager)6 ActionLog (core.framework.impl.log.ActionLog)5 ByteArraySerializer (org.apache.kafka.common.serialization.ByteArraySerializer)1 StringSerializer (org.apache.kafka.common.serialization.StringSerializer)1 BeforeEach (org.junit.jupiter.api.BeforeEach)1