<commit_before>package com.boundary.sdk.event.syslog;


import java.util.Date;

import org.productivity.java.syslog4j.Syslog;
import org.productivity.java.syslog4j.SyslogIF;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Class to generate syslog messages for testing
 * 
 * @author davidg
 *
 */
public class SyslogMessageGenerator {
	
	private static Logger LOG = LoggerFactory.getLogger(SyslogMessageGenerator.class);
	
	private SyslogIF syslog;
	
	private static final int DEFAULT_COUNT=10;
	private static final int DEFAULT_DELAY=10;
	
	private int count = DEFAULT_COUNT;
	private int delay = DEFAULT_DELAY;

	public SyslogMessageGenerator() {
		syslog = Syslog.getInstance("udp");
		syslog.getConfig().setUseStructuredData(false);
		syslog.getConfig().setHost("localhost");
		syslog.getConfig().setFacility(SyslogIF.FACILITY_LOCAL0);
		count = DEFAULT_COUNT;
		delay = DEFAULT_DELAY;
	}
	
	public void setCount(int count) {
		this.count = count;
	}
	
	public void setDelay(int delay) {
		this.delay = delay;
	}
	
	/**
	 * Sets the host on the syslog message
	 * 
	 * @param host
	 */
	public void setHost(String host) {
		syslog.getConfig().setHost(host);
	}
	
	/**
	 * Sets the facility on the syslog message
	 * 
	 * @param facility
	 */
	public void setFacility(int facility) {
		syslog.getConfig().setFacility(facility);
	}
	
	/**
	 * Set the port to send the syslog message
	 * 
	 * @param port
	 */
	public void setPort(int port) {
		syslog.getConfig().setPort(port);
	}
	
	/**
	 * Sends syslog messages with values set for count and delay.
	 * 
	 * @throws InterruptedException
	 */
	public void sendMessages() throws InterruptedException {
		sendMessages(count,delay);
	}
	
	/**
	 * Sends syslog messages with the specified count and delay.
	 * 
	 * @param count
	 * @param delay
	 * @throws InterruptedException
	 */
	public void sendMessages(int count,int delay) throws InterruptedException {
		for (int n = count ; n != 0 ; n--) {
			
			syslog.info(new Date() + "TESTING------TESTING-----TESTING-----TESTING");
			if (n != count && n % 10 == 0) {
				LOG.info("Sent " + (count - n) + " messages");
			}
			Thread.sleep(delay);
		}
		LOG.info("Sent " + count + " messages");

	}
	
	/**
	 * 
	 * @param args
	 */<commit_msg>Changed message produced<commit_after>package com.boundary.sdk.event.syslog;


import java.util.Date;

import org.productivity.java.syslog4j.Syslog;
import org.productivity.java.syslog4j.SyslogIF;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Class to generate syslog messages for testing
 * 
 * @author davidg
 *
 */
public class SyslogMessageGenerator {
	
	private static Logger LOG = LoggerFactory.getLogger(SyslogMessageGenerator.class);
	
	private SyslogIF syslog;
	
	private static final int DEFAULT_COUNT=10;
	private static final int DEFAULT_DELAY=10;
	
	private int count = DEFAULT_COUNT;
	private int delay = DEFAULT_DELAY;

	public SyslogMessageGenerator() {
		syslog = Syslog.getInstance("udp");
		syslog.getConfig().setUseStructuredData(false);
		syslog.getConfig().setHost("localhost");
		syslog.getConfig().setFacility(SyslogIF.FACILITY_LOCAL0);
		count = DEFAULT_COUNT;
		delay = DEFAULT_DELAY;
	}
	
	public void setCount(int count) {
		this.count = count;
	}
	
	public void setDelay(int delay) {
		this.delay = delay;
	}
	
	/**
	 * Sets the host on the syslog message
	 * 
	 * @param host
	 */
	public void setHost(String host) {
		syslog.getConfig().setHost(host);
	}
	
	/**
	 * Sets the facility on the syslog message
	 * 
	 * @param facility
	 */
	public void setFacility(int facility) {
		syslog.getConfig().setFacility(facility);
	}
	
	/**
	 * Set the port to send the syslog message
	 * 
	 * @param port
	 */
	public void setPort(int port) {
		syslog.getConfig().setPort(port);
	}
	
	/**
	 * Sends syslog messages with values set for count and delay.
	 * 
	 * @throws InterruptedException
	 */
	public void sendMessages() throws InterruptedException {
		sendMessages(count,delay);
	}
	
	/**
	 * Sends syslog messages with the specified count and delay.
	 * 
	 * @param count
	 * @param delay
	 * @throws InterruptedException
	 */
	public void sendMessages(int count,int delay) throws InterruptedException {
		for (int n = count ; n != 0 ; n--) {
			
			syslog.info(new Date() + "TEST MESSAGE");
			if (n != count && n % 10 == 0) {
				LOG.info("Sent " + (count - n) + " messages");
			}
			Thread.sleep(delay);
		}
		LOG.info("Sent " + count + " messages");

	}
	
	/**
	 * 
	 * @param args
	 */
{'fraction_non_alphanumeric': 0.12330291564656132, 'fraction_numerical': 0.005786779434676163, 'mean_word_length': 3.4583333333333335, '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': '2562887', 'n_tokens_mistral': 1618, 'n_tokens_neox': 1421, 'n_words': 367}