<commit_before>package com.ociweb.iot.maker;

import java.io.File;
import java.io.IOException;

/**
 * Time-based image listener backing for Raspberry Pi hardware.
 *
 * @author <NAME> [<EMAIL>]
 */
public class PiImageListenerBacking implements TimeListener {

    private final ImageListener handler;

    /**
     * Takes a picture from the currently connected Raspberry Pi camera and
     * saves it to a file.
     *
     * TODO: This method is primitive in that it relies on Pi command line tools
     *       and unknown delays in order to capture images. It would be preferable
     *       to leverage the native APIs in the Raspberry Pi, but those are
     *       extremely complex and undocumented...
     *
     * @param fileName Name of the file (without extensions) to save
     *                 the image to.
     *
     * @return A reference to the created image file.
     */
    public static File takePicture(String fileName) {
        try {
            Runtime.getRuntime().exec("raspistill --nopreview --timeout 1 --shutter 2500 --width 1280 --height 960 --quality 75 --output " + fileName + ".jpg");
        } catch (IOException e) {
            e.printStackTrace();
        }

        return new File(fileName + ".jpg");
    }

    public PiImageListenerBacking(ImageListener handler) {
        this.handler = handler;
    }

    @Override
    public void timeEvent(long time) {
        File f = takePicture("Pronghorn-Image-Capture-" + time);
        handler.onImage(f);
    }
}<commit_msg>Remove stack trace print<commit_after>package com.ociweb.iot.maker;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.File;
import java.io.IOException;

/**
 * Time-based image listener backing for Raspberry Pi hardware.
 *
 * @author <NAME> [<EMAIL>]
 */
public class PiImageListenerBacking implements TimeListener {

    private static final Logger logger = LoggerFactory.getLogger(PiImageListenerBacking.class);

    private final ImageListener handler;

    /**
     * Takes a picture from the currently connected Raspberry Pi camera and
     * saves it to a file.
     *
     * TODO: This method is primitive in that it relies on Pi command line tools
     *       and unknown delays in order to capture images. It would be preferable
     *       to leverage the native APIs in the Raspberry Pi, but those are
     *       extremely complex and undocumented...
     *
     * @param fileName Name of the file (without extensions) to save
     *                 the image to.
     *
     * @return A reference to the created image file.
     */
    public static File takePicture(String fileName) {
        try {
            Runtime.getRuntime().exec("raspistill --nopreview --timeout 1 --shutter 2500 --width 1280 --height 960 --quality 75 --output " + fileName + ".jpg");
        } catch (IOException e) {
            logger.error("Unable to take picture from Raspberry Pi Camera due to error [{}].", e.getMessage(), e);
        }

        return new File(fileName + ".jpg");
    }

    public PiImageListenerBacking(ImageListener handler) {
        this.handler = handler;
    }

    @Override
    public void timeEvent(long time) {
        File f = takePicture("Pronghorn-Image-Capture-" + time);
        handler.onImage(f);
    }
}
{'fraction_non_alphanumeric': 0.09146341463414634, 'fraction_numerical': 0.009146341463414634, 'mean_word_length': 2.439203354297694, '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': '6815231', 'n_tokens_mistral': 918, 'n_tokens_neox': 860, 'n_words': 323}