<commit_before>package main

import (
	"github.com/op/go-logging"

	"os"
)

var (
	log    = logging.MustGetLogger("syaro")
	format = logging.MustStringFormatter(
		"%{time:2006/01/02 15:04:05.000000} %{shortpkg:-6.6s} %{shortfunc:-12.12s} | %{color:bold}%{level:.4s}%{color:reset} %{color}%{message}%{color:reset}",
	)
)

func SetupLogger() {
	backend := logging.NewLogBackend(os.Stdout, "", 0)
	backendFormatter := logging.NewBackendFormatter(backend, format)
	backendLeveled := logging.AddModuleLevel(backendFormatter)
	if setting.verbose {
		backendLeveled.SetLevel(logging.DEBUG, "")
	} else {
		backendLeveled.SetLevel(logging.INFO, "")
	}
	log.SetBackend(backendLeveled)
}
<commit_msg>[MOD] logger (color, quiet)<commit_after>package main

import (
	"github.com/op/go-logging"

	"os"
)

const (
	LOG_FORMAT       = "%{time:2006/01/02 15:04:05.000000} syaro %{shortfunc:-12.12s} | %{level:.4s} %{message}"
	COLOR_LOG_FORMAT = "%{time:2006/01/02 15:04:05.000000} syaro %{shortfunc:-12.12s} | %{color:bold}%{level:.4s}%{color:reset} %{color}%{message}%{color:reset}"
)

var (
	log = logging.MustGetLogger("syaro")
)

func setupLogger() {
	backend := logging.NewLogBackend(os.Stdout, "", 0)
	var format logging.Formatter
	if setting.color {
		format = logging.MustStringFormatter(COLOR_LOG_FORMAT)
	} else {
		format = logging.MustStringFormatter(LOG_FORMAT)
	}
	backendFormatter := logging.NewBackendFormatter(backend, format)
	backendLeveled := logging.AddModuleLevel(backendFormatter)
	if setting.verbose {
		backendLeveled.SetLevel(logging.DEBUG, "")
	} else if setting.quiet {
		backendLeveled.SetLevel(logging.ERROR, "")
	} else {
		backendLeveled.SetLevel(logging.INFO, "")
	}
	log.SetBackend(backendLeveled)
}

{'fraction_non_alphanumeric': 0.16744186046511628, 'fraction_numerical': 0.045930232558139536, 'mean_word_length': 5.568702290076335, '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': '3450865', 'n_tokens_mistral': 690, 'n_tokens_neox': 612, 'n_words': 88}