package org.musetest.core.events;

import org.musetest.core.*;
import org.musetest.core.context.initializers.*;
import org.musetest.core.datacollection.*;
import org.musetest.core.events.matching.*;

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

/**
 * @author Christopher L Merrill (see LICENSE.txt for license details)
 */
public class EventLogger implements MuseEventListener, DataCollector
    {
	@Override
	public void initialize(MuseExecutionContext context) throws MuseExecutionError
		{
		context.addEventListener(this);
		}

    @Override
    public String getType()
	    {
	    return "event-logger";
	    }

    @Override
    public void configure(ContextInitializerConfiguration configuration)
	    {
	    // doesn't currently need configuration
	    }

    @Override
    public void eventRaised(MuseEvent event)
        {
        _log.add(event);
        }

	@Override
	public EventLog getData()
		{
		return _log;
		}

	private EventLog _log = new EventLog();
    }



@@ -605,22 +605,15 @@
 urn 
-%22event-logger%22
+TYPE_ID
 ;%0A%09 
@@ -977,12 +977,490 @@
 ();%0A
+%0A    public final static String TYPE_ID = %22event-logger%22;%0A%0A    @SuppressWarnings(%22unused%22) // used by reflection%0A  %09public static class EventLoggerType extends ContextInitializerType%0A  %09%09%7B%0A  %09%09@Override%0A  %09%09public String getTypeId()%0A  %09%09%09%7B%0A  %09%09%09return TYPE_ID;%0A  %09%09%09%7D%0A%0A  %09%09@Override%0A  %09%09public String getDisplayName()%0A  %09%09%09%7B%0A  %09%09%09return %22Event Logger%22;%0A  %09%09%09%7D%0A%0A  %09%09@Override%0A  %09%09public String getShortDescription()%0A  %09%09%09%7B%0A  %09%09%09return %22Captures a log of test events%22;%0A  %09%09%09%7D%0A  %09%09%7D%0A%0A
     %7D
-%0A%0A%0A

Implement ContextInitializerType for the EventLogger.