<commit_before>package org.musetest.core.events;

import org.musetest.core.*;
import org.musetest.core.util.*;

import java.io.*;
import java.util.*;

/**
 * @author <NAME> (see LICENSE.txt for license details)
 */
public class EventLogPrinter
    {
    public EventLogPrinter(PrintStream out)
        {
        _out = out;
        _indent_stack.push(" ");
        }

    public EventLogPrinter(PrintStream out, long first_event_nanos)
        {
        _out = out;
        _first_time = first_event_nanos;
        _indent_stack.push(" ");
        }

    public void print(MuseEvent event)
        {
        if (_first_time == -1) // first time
            _first_time = System.nanoTime();

        if (event.getType().equals(MuseEventType.StartStep))
            _indent_stack.push(_indent_stack.peek() + "  ");

        _out.print(DurationFormat.formatMinutesSeconds(event.getTimestampNanos() - _first_time));
        _out.print(_indent_stack.peek());
        _out.println(event.getDescription());

        if (event.getType().equals(MuseEventType.EndStep))
            _indent_stack.pop();
        }

    private PrintStream _out;
    private long _first_time = -1;<commit_msg>improve log output<commit_after>package org.musetest.core.events;

import org.musetest.core.*;
import org.musetest.core.step.*;
import org.musetest.core.util.*;

import java.io.*;
import java.util.*;

/**
 * @author <NAME> (see LICENSE.txt for license details)
 */
public class EventLogPrinter
    {
    public EventLogPrinter(PrintStream out)
        {
        _out = out;
        _indent_stack.push(" ");
        }

    public EventLogPrinter(PrintStream out, long first_event_nanos)
        {
        _out = out;
        _first_time = first_event_nanos;
        _indent_stack.push(" ");
        }

    public void print(MuseEvent event)
        {
        if (_first_time == -1) // first time
            _first_time = System.nanoTime();

        if (event.getType().equals(MuseEventType.StartStep))
            _indent_stack.push(_indent_stack.peek() + "  ");

        _out.print(DurationFormat.formatMinutesSeconds(event.getTimestampNanos() - _first_time));
        if (!_indent_stack.isEmpty()) // this should never happen, but just in case...avoid an exception
            _out.print(_indent_stack.peek());
        _out.println(event.getDescription());

        if (event.getType().equals(MuseEventType.EndStep) && !((StepEvent)event).getResult().getStatus().equals(StepExecutionStatus.INCOMPLETE) && _indent_stack.size() > 1)  // never pop the first indent (something else has gone wrong).
            _indent_stack.pop();
        }

    private PrintStream _out;
    private long _first_time = -1;
{'fraction_non_alphanumeric': 0.12364990689013035, 'fraction_numerical': 0.00186219739292365, 'mean_word_length': 2.6494565217391304, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, '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': '6815705', 'n_tokens_mistral': 827, 'n_tokens_neox': 814, 'n_words': 156}