<commit_before>package com.miguelgaeta.bootstrap.mg_log;

import lombok.Getter;
import timber.log.Timber;

/**
 * Created by mrkcsc on 3/15/15.
 */
@SuppressWarnings("UnusedDeclaration")
public class MGLog {

    @Getter
    private static MGLogConfig config = new MGLogConfig();

    /**
     * Callback info and error interfaces.
     */
    public interface Callback {

        interface Info {

            void run(Throwable throwable, String message);
        }

        interface Error {

            void run(Throwable throwable, String message);
        }
    }

    /**
     * Info level message.
     */
    public static void i(String message, Object... args) {
        Timber.i(message, args);
    }

    /**
     * Info level message with throwable.
     */
    public static void i(Throwable t, String message, Object... args) {
        Timber.i(t, message, args);
    }

    /**
     * Error level message.
     */
    public static void e(String message, Object... args) {
        Timber.e(message, args);
    }

    /**
     * Error level message with throwable.
     */
    public static void e(Throwable t, String message, Object... args) {
        Timber.e(t, message, args);
    }
}<commit_msg>Added helper method to generate a stack trace that excludes specified tag(s).<commit_after>package com.miguelgaeta.bootstrap.mg_log;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import lombok.Getter;
import timber.log.Timber;

/**
 * Created by mrkcsc on 3/15/15.
 */
@SuppressWarnings("UnusedDeclaration")
public class MGLog {

    @Getter
    private static MGLogConfig config = new MGLogConfig();

    /**
     * Callback info and error interfaces.
     */
    public interface Callback {

        interface Info {

            void run(Throwable throwable, String message);
        }

        interface Error {

            void run(Throwable throwable, String message);
        }
    }

    /**
     * Info level message.
     */
    public static void i(String message, Object... args) {
        Timber.i(message, args);
    }

    /**
     * Info level message with throwable.
     */
    public static void i(Throwable t, String message, Object... args) {
        Timber.i(t, message, args);
    }

    /**
     * Error level message.
     */
    public static void e(String message, Object... args) {
        Timber.e(message, args);
    }

    /**
     * Error level message with throwable.
     */
    public static void e(Throwable t, String message, Object... args) {
        Timber.e(t, message, args);
    }

    private static StackTraceElement[] getStackTrace(StackTraceElement[] stackTrace, String exclusionTag) {

        return getStackTrace(stackTrace, Collections.singletonList(exclusionTag));
    }

    private static StackTraceElement[] getStackTrace(StackTraceElement[] stackTrace, List<String> exclusionTags) {

        ArrayList<StackTraceElement> modifiedStackTrace = new ArrayList<>();

        for (StackTraceElement element : stackTrace) {

            boolean includeElement = true;

            for (String exclusionTag : exclusionTags) {

                if (element.getClassName().contains(exclusionTag)) {

                    includeElement = false;
                }
            }

            if (includeElement) {

                modifiedStackTrace.add(element);
            }
        }

        return modifiedStackTrace.toArray(new StackTraceElement[modifiedStackTrace.size()]);
    }
}
{'fraction_non_alphanumeric': 0.1044776119402985, 'fraction_numerical': 0.0028702640642939152, 'mean_word_length': 2.2179132040627887, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, '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': '18918', 'n_tokens_mistral': 986, 'n_tokens_neox': 941, 'n_words': 263}