All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.newrelic.opentracing.logging.InMemoryLogger Maven / Gradle / Ivy

Go to download

New Relic OpenTracing Tracer implementation for instrumenting AWS Lambda functions.

The newest version!
/*
 * Copyright 2020 New Relic Corporation. All rights reserved.
 * SPDX-License-Identifier: Apache-2.0
 */

package com.newrelic.opentracing.logging;

import java.util.LinkedList;
import java.util.List;

/**
 * The in-memory logger does not write to standard out, but instead saves all messages
 * in memory, and can be used by tests to check if certain messages were logged.
 */
public class InMemoryLogger implements Logger {

    private final List logs = new LinkedList<>();

    @Override
    public void out(String message) {
        logs.add(message);
    }

    @Override
    public void debug(String message) {
        logs.add(message);
    }

    @Override
    public List getLogs() {
        return logs;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy