<commit_before>package com.wiley.autotest.selenium;

import org.apache.commons.lang.exception.ExceptionUtils;
import org.slf4j.LoggerFactory;
import org.testng.Reporter;
import ru.yandex.qatools.allure.annotations.Step;

/**
 * Transfers message to necessary end point
 * TestNG
 * Allure
 * Jenkins console
 */
public class Report {
    private String message;

    public Report(String message) {
        this.message = message;
    }

    public Report(String message, Throwable t) {
        this(message + "\n" + ExceptionUtils.getStackTrace(t));
    }

    public void testNG() {
        Reporter.log(message + "<br/>");
    }

    public void allure() {
        allure(message);
    }

    /**
     * hack to send message to allure
     */
    @Step("{0}")
    private void allure(String message) {
    }

    /**
     * Making it an 'error' to guarantee that message will be shown with any log level settings
     */
    public void jenkins() {
        LoggerFactory.getLogger(this.getClass()).error(message);
    }

    public void everywhere() {
        testNG();
        allure();
        jenkins();
    }

}<commit_msg>Set INFO level as default for Report<commit_after>package com.wiley.autotest.selenium;

import org.apache.commons.lang.exception.ExceptionUtils;
import org.slf4j.LoggerFactory;
import org.slf4j.event.Level;
import org.testng.Reporter;
import ru.yandex.qatools.allure.annotations.Step;

/**
 * Transfers message to necessary end point
 * TestNG
 * Allure
 * Jenkins console
 */
public class Report {

    private String message;
    private Level level = Level.INFO;

    public Report(String message) {
        this.message = message;
    }

    public Report(String message, Level level) {
        this.message = message;
        this.level = level;
    }

    public Report(String message, Throwable t) {
        this(message + "\n" + ExceptionUtils.getStackTrace(t));
    }

    public Report(String message, Throwable t, Level level) {
        this(message + "\n" + ExceptionUtils.getStackTrace(t), level);
    }

    public void testNG() {
        Reporter.log(message + "<br/>");
    }

    public void allure() {
        allure(message);
    }

    /**
     * hack to send message to allure
     */
    @Step("{0}")
    private void allure(String message) {
    }

    public void jenkins() {
        switch (level) {
            case INFO:
                LoggerFactory.getLogger(this.getClass()).info(message);
                break;
            case WARN:
                LoggerFactory.getLogger(this.getClass()).warn(message);
                break;
            case DEBUG:
                LoggerFactory.getLogger(this.getClass()).debug(message);
                break;
            case ERROR:
                LoggerFactory.getLogger(this.getClass()).error(message);
                break;
        }
    }

    public void everywhere() {
        testNG();
        allure();
        jenkins();
    }
}
{'fraction_non_alphanumeric': 0.11424685481128868, 'fraction_numerical': 0.0017001020061203672, 'mean_word_length': 2.2365236523652365, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '5103150', 'n_tokens_mistral': 862, 'n_tokens_neox': 835, 'n_words': 203}