<commit_before>package org.metaborg.spoofax.eclipse.meta.build;

import java.io.PrintStream;

import org.apache.tools.ant.DefaultLogger;
import org.eclipse.ui.console.MessageConsole;
import org.metaborg.spoofax.eclipse.util.ConsoleUtils;

public class SpoofaxAntBuildLogger extends DefaultLogger {
    private final MessageConsole console;
    private final PrintStream stream;


    public SpoofaxAntBuildLogger() {
        super();
        console = ConsoleUtils.get("Spoofax language build");
        stream = new PrintStream(console.newMessageStream());
        console.activate();
    }


    @Override protected void printMessage(String message, PrintStream unusedStream, int priority) {
        /*
         * HACK: instead of setting the output and error streams, just pass our own stream to printMessage. The reason
         * being that Ant likes to change the stream to stdout and stderr after class instantiation, overriding our
         * streams.
         */
        super.printMessage(message, stream, priority);<commit_msg>Clear language build console before building.<commit_after>package org.metaborg.spoofax.eclipse.meta.build;

import java.io.PrintStream;

import org.apache.tools.ant.DefaultLogger;
import org.eclipse.ui.console.MessageConsole;
import org.metaborg.spoofax.eclipse.util.ConsoleUtils;

public class SpoofaxAntBuildLogger extends DefaultLogger {
    private final MessageConsole console;
    private final PrintStream stream;


    public SpoofaxAntBuildLogger() {
        super();
        console = ConsoleUtils.get("Spoofax language build");
        stream = new PrintStream(console.newMessageStream());
        console.clearConsole();
        console.activate();
    }


    @Override protected void printMessage(String message, PrintStream unusedStream, int priority) {
        /*
         * HACK: instead of setting the output and error streams, just pass our own stream to printMessage. The reason
         * being that Ant likes to change the stream to stdout and stderr after class instantiation, overriding our
         * streams.
         */
        super.printMessage(message, stream, priority);
{'fraction_non_alphanumeric': 0.07710280373831775, 'fraction_numerical': 0.0, 'mean_word_length': 3.4697286012526094, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '540294', 'n_tokens_mistral': 553, 'n_tokens_neox': 532, 'n_words': 169}