<commit_before>package io.logspace.hq.webapp.resource;

import javax.annotation.PostConstruct;
import javax.inject.Named;

import com.indoqa.spark.AbstractResourcesBase;

@Named
public class EventResource extends AbstractResourcesBase {

    @PostConstruct
    public void mount() {
        this.postAsJson("/events", (req, res) -> "foo");
    }
}<commit_msg>use logging to write received events<commit_after>package io.logspace.hq.webapp.resource;

import javax.annotation.PostConstruct;
import javax.inject.Named;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import spark.Request;
import spark.Response;
import spark.Spark;

import com.indoqa.spark.AbstractResourcesBase;

@Named
public class EventResource extends AbstractResourcesBase {

    private final Logger logger = LoggerFactory.getLogger(this.getClass());

    @PostConstruct
    public void mount() {
        Spark.post("/events", (req, res) -> this.logEvents(req, res));
    }

    private String logEvents(Request req, Response res) {
        this.logger.info(req.body());
        res.status(202);
        return "";
    }
}
{'fraction_non_alphanumeric': 0.11242067089755213, 'fraction_numerical': 0.004533091568449683, 'mean_word_length': 4.087557603686636, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4336350', 'n_tokens_mistral': 329, 'n_tokens_neox': 320, 'n_words': 74}