<commit_before><commit_msg>Added tests for logging<commit_after>package logger

import (
	"testing"

	"github.com/Sirupsen/logrus"
	. "github.com/smartystreets/goconvey/convey"
)

func Test(t *testing.T) {
	Convey("Testing Logger", t, func() {
		So(Logger, ShouldNotBeNil)
	})
}

func TestSetupLogging(t *testing.T) {
	Convey("Testing SetupLogging()", t, func() {
		Reset(func() {
			Logger.Level = logrus.InfoLevel
		})
		Convey("InspectParent=false", func() {
			So(Logger.Level, ShouldEqual, logrus.InfoLevel)
			options := LoggerOptions{
				Level:         logrus.WarnLevel,
				InspectParent: false,
			}
			SetupLogging(options)
			So(Logger.Level, ShouldEqual, logrus.WarnLevel)
		})
		Convey("InspectParent=true", func() {
			// FIXME: mock process
			So(Logger.Level, ShouldEqual, logrus.InfoLevel)
			options := LoggerOptions{
				Level:         logrus.WarnLevel,
				InspectParent: true,
			}
			SetupLogging(options)
			So(Logger.Level, ShouldEqual, logrus.InfoLevel)
		})
	})
}

func TestGetLoggingLevelByInspectingParent(t *testing.T) {
	Convey("Testing GetLoggingLevelByInspectingParent()", t, func() {
		// FIXME: mock process
		level, err := GetLoggingLevelByInspectingParent()
		So(err, ShouldBeNil)
		So(level, ShouldEqual, logrus.InfoLevel)
	})
}
{'fraction_non_alphanumeric': 0.13507109004739337, 'fraction_numerical': 0.0, 'mean_word_length': 4.279166666666667, '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': '5184832', 'n_tokens_mistral': 491, 'n_tokens_neox': 447, 'n_words': 79}