<commit_before>package log

import "os"
import "firempq/conf"
import "github.com/op/go-logging"
import "log"

func InitLogging() {
	format := logging.MustStringFormatter(
		"%{color}%{time:2006-01-02 15:04:05.00000}: %{level}%{color:reset} %{shortfile} %{message}",
	)
	logbackend := logging.NewLogBackend(os.Stderr, "", 0)
	formatter := logging.NewBackendFormatter(logbackend, format)
	logging.SetBackend(formatter)
	logging.SetLevel(conf.CFG.LogLevel, "firempq")
	fixLogger()
}

func fixLogger() {
	Logger.ExtraCalldepth = 1
}

var Logger = logging.MustGetLogger("firempq")

var Error func(string, ...interface{}) = Logger.Error
var Critical func(string, ...interface{}) = Logger.Critical
var Warning func(string, ...interface{}) = Logger.Warning
var Notice func(string, ...interface{}) = Logger.Notice
var Info func(string, ...interface{}) = Logger.Info
var Debug func(string, ...interface{}) = Logger.Debug
var Fatal func(string, ...interface{}) = log.Fatalf<commit_msg>Added function to set log level<commit_after>package log

import "os"
import "firempq/conf"
import "github.com/op/go-logging"
import "log"

func InitLogging() {
	format := logging.MustStringFormatter(
		"%{color}%{time:2006-01-02 15:04:05.00000}: %{level}%{color:reset} %{shortfile} %{message}",
	)
	logbackend := logging.NewLogBackend(os.Stderr, "", 0)
	formatter := logging.NewBackendFormatter(logbackend, format)
	logging.SetBackend(formatter)
	logging.SetLevel(conf.CFG.LogLevel, "firempq")
	fixLogger()
}

func fixLogger() {
	Logger.ExtraCalldepth = 1
}

func SetLevel(l logging.Level) {
	logging.SetLevel(l, "firempq")
}

var Logger = logging.MustGetLogger("firempq")

var Error func(string, ...interface{}) = Logger.Error
var Critical func(string, ...interface{}) = Logger.Critical
var Warning func(string, ...interface{}) = Logger.Warning
var Notice func(string, ...interface{}) = Logger.Notice
var Info func(string, ...interface{}) = Logger.Info
var Debug func(string, ...interface{}) = Logger.Debug
var Fatal func(string, ...interface{}) = log.Fatalf
{'fraction_non_alphanumeric': 0.16764995083579154, 'fraction_numerical': 0.02064896755162242, 'mean_word_length': 5.4603174603174605, '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': '4283106', 'n_tokens_mistral': 700, 'n_tokens_neox': 653, 'n_words': 151}