<commit_before>
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import org.jnetpcap.Pcap;
import org.jnetpcap.PcapIf;

public class Main {

	public static void main(String[] args) throws IOException {
		List<PcapIf> alldevs = new ArrayList<PcapIf>(); // Will be filled with NICs
		StringBuilder errbuf = new StringBuilder(); // For any error msgs

		/***************************************************************************
		 * First get a list of devices on this system
		 **************************************************************************/
		int r = Pcap.findAllDevs(alldevs, errbuf);
		if (r != Pcap.OK || alldevs.isEmpty()) {
			System.err.printf("Can't read list of devices, error is %s", errbuf.toString());
			return;
		}

		System.out.println("Network devices found:");

		int i = 0;
		for (PcapIf device : alldevs) {

			System.out.println((i++) + "\t" + device.getName());
		}

		Pcap pcap = Pcap.openLive(alldevs.get(0).getName(), 64*1024, Pcap.MODE_PROMISCUOUS, 10*1000, errbuf);

		if (pcap == null) {
			System.err.printf("Error while opening device for capture: " + errbuf.toString());
			return;
		}
		pcap.loop(-1, new PacketInspector(), "");

		pcap.close();
	}
}<commit_msg>Update Main.java<commit_after>import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import org.apache.log4j.Logger;
import org.jnetpcap.Pcap;
import org.jnetpcap.PcapIf;

public class Main {
	public static Logger debugger = Logger.getLogger("debugLogger");
	public static Logger matchLog = Logger.getLogger("infoLogger");
	
	public static void main(String[] args) throws IOException {

		
		List<PcapIf> alldevs = new ArrayList<PcapIf>(); 
		
		StringBuilder errbuf = new StringBuilder(); 
		int r = Pcap.findAllDevs(alldevs, errbuf);
		if (r != Pcap.OK || alldevs.isEmpty()) {
		debugger.debug("Can't read list of devices, error is %s"+errbuf.toString());
			return;
		}

		PcapIf device = alldevs.get(1); 
		matchLog.info(device.getName());

		int snaplen = 64 * 1024; 
		int flags = Pcap.MODE_PROMISCUOUS; 
		int timeout = 10 * 1000; 
		Pcap pcap = Pcap.openLive(device.getName(), snaplen, flags, timeout, errbuf);

		if (pcap == null) {
		debugger.debug("Error while opening device for capture: " + errbuf.toString());
			return;
		}
		pcap.loop(-1, new PacketInspector(), "jNetPcap rocks!");

		pcap.close();

	}
}
{'fraction_non_alphanumeric': 0.19605373635600337, 'fraction_numerical': 0.012594458438287154, 'mean_word_length': 4.307349665924276, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '7435142', 'n_tokens_mistral': 884, 'n_tokens_neox': 772, 'n_words': 197}