<commit_before>package log

import (
	"fmt"
	"github.com/daviddengcn/go-colortext"
	"io"
	l "log"
	"os"
)

const (
	MUTE = iota
	DEBUG
	INFO
	WARN
	CRITICAL
	ERROR = 99
)

// configurations
var LogLevel = DEBUG
var Logger = l.New(defaultOutput, "", l.LstdFlags|l.Lshortfile)

type color struct {
	value  ct.Color
	bright bool
}

var Colors = map[int]color{
	DEBUG:    {ct.White, false},
	INFO:     {ct.Green, false},
	WARN:     {ct.Yellow, false},
	CRITICAL: {ct.Red, true},
	ERROR:    {ct.Red, false},
}

var Tags = map[int]string{
	DEBUG:    "debug",
	INFO:     "info",
	WARN:     "warn",
	CRITICAL: "critical",
	ERROR:    "error",
}

type fder interface {
	Fd() uintptr
}

var defaultOutput io.Writer = os.Stderr

func SetOutput(out io.Writer, prefix string, flag int) {
	defaultOutput = out
	Logger = l.New(out, prefix, flag)
}

func Debugf(format string, args ...interface{}) {
	if levelOK(DEBUG) {
		logf(DEBUG, format, args...)
	}
}

func Debug(args ...interface{}) {
	if levelOK(DEBUG) {
		log(DEBUG, args...)
	}
}

func Infof(format string, args ...interface{}) {
	if levelOK(INFO) {
		logf(INFO, format, args...)
	}
}

func Info(args ...interface{}) {
	if levelOK(INFO) {
		log(INFO, args...)<commit_msg>Separate methods<commit_after>package log

import (
	"fmt"
	"github.com/daviddengcn/go-colortext"
	"io"
	l "log"
	"os"
)

const (
	MUTE = iota
	DEBUG
	INFO
	WARN
	CRITICAL
	ERROR = 99
)

// configurations
var LogLevel = DEBUG
var Logger = l.New(defaultOutput, "", l.LstdFlags|l.Lshortfile)

type color struct {
	value  ct.Color
	bright bool
}

var Colors = map[int]color{
	DEBUG:    {ct.White, false},
	INFO:     {ct.Green, false},
	WARN:     {ct.Yellow, false},
	CRITICAL: {ct.Red, true},
	ERROR:    {ct.Red, false},
}

var Tags = map[int]string{
	DEBUG:    "debug",
	INFO:     "info",
	WARN:     "warn",
	CRITICAL: "critical",
	ERROR:    "error",
}

type fder interface {
	Fd() uintptr
}

var defaultOutput io.Writer = os.Stderr

func SetFlags(flags int) {
	Logger.SetFlags(flags)
}

func SetPrefix(prefix string) {
	Logger.SetPrefix(prefix)
}

func SetOutput(out io.Writer) {
	defaultOutput = out
	Logger = l.New(out, Logger.Prefix(), Logger.Flags())
}

func Debugf(format string, args ...interface{}) {
	if levelOK(DEBUG) {
		logf(DEBUG, format, args...)
	}
}

func Debug(args ...interface{}) {
	if levelOK(DEBUG) {
		log(DEBUG, args...)
	}
}

func Infof(format string, args ...interface{}) {
	if levelOK(INFO) {
		logf(INFO, format, args...)
	}
}

func Info(args ...interface{}) {
	if levelOK(INFO) {
		log(INFO, args...)
{'fraction_non_alphanumeric': 0.16377952755905512, 'fraction_numerical': 0.0015748031496062992, 'mean_word_length': 3.365979381443299, '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': '3757983', 'n_tokens_mistral': 1018, 'n_tokens_neox': 994, 'n_words': 244}