<commit_before>package clisetup

import (
	"github.com/containerum/chkit/pkg/cli/mode"
	"github.com/containerum/chkit/pkg/client"
	. "github.com/containerum/chkit/pkg/context"
	"github.com/sirupsen/logrus"
)

func SetupClient() error {
	var err error
	if mode.DEBUG && !mode.MOCK {
		logrus.Debugf("Using test API: %q", Context.APIaddr)
		if Config.DebugRequests {
			logrus.Debugf("verbose requests logs")
			Context.Client.Log = logrus.StandardLogger().WriterLevel(logrus.DebugLevel)
		}
		err = Context.Client.Init(chClient.WithTestAPI)
	} else if mode.DEBUG && mode.MOCK {
		logrus.Debugf("Using mock API")
		err = Context.Client.Init(chClient.WithMock)
	} else {
		logrus.Debugf("Using production API: %v", Context.APIaddr)
		err = Context.Client.Init(chClient.WithCommonAPI)
	}<commit_msg>fix logs<commit_after>package clisetup

import (
	"github.com/containerum/chkit/pkg/cli/mode"
	"github.com/containerum/chkit/pkg/client"
	. "github.com/containerum/chkit/pkg/context"
	"github.com/sirupsen/logrus"
)

func SetupClient() error {
	var err error
	if mode.DEBUG && !mode.MOCK {
		logrus.WithField("operation", "SetupClient").Debugf("Using test API: %q", Context.Client.APIaddr)
		if Config.DebugRequests {
			logrus.Debugf("verbose requests logs")
			Context.Client.Log = logrus.StandardLogger().WriterLevel(logrus.DebugLevel)
		}
		err = Context.Client.Init(chClient.WithTestAPI)
	} else if mode.DEBUG && mode.MOCK {
		logrus.Debugf("Using mock API")
		err = Context.Client.Init(chClient.WithMock)
	} else {
		logrus.Debugf("Using production API: %v", Context.Client.APIaddr)
		err = Context.Client.Init(chClient.WithCommonAPI)
	}
{'fraction_non_alphanumeric': 0.14050091631032377, 'fraction_numerical': 0.0, 'mean_word_length': 4.6482758620689655, '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': '3071110', 'n_tokens_mistral': 607, 'n_tokens_neox': 581, 'n_words': 96}