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

com.testdroid.api.serialization.level.Log4jLevelSerializer Maven / Gradle / Ivy

There is a newer version: 3.34.0
Show newest version
package com.testdroid.api.serialization.level;

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import org.apache.logging.log4j.Level;

import java.io.IOException;

/**
 * @author Artur Ćwikliński 
 */
public class Log4jLevelSerializer extends StdSerializer {

    protected Log4jLevelSerializer(Class t) {
        super(t);
    }

    @Override
    public void serialize(Level level, JsonGenerator jsonGenerator, SerializerProvider serializerProvider)
            throws IOException {
        jsonGenerator.writeString(level.name());
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy