<commit_before>package opentracing

import "math"

const (
	stringType fieldType = iota
	boolType
	intType
	int64Type
	float64Type
	errorType
	objectType
	deferredObjectType
)

// LogField instances are constructed via LogBool, LogString, and so on.
// Tracing implementations may then handle them via the LogField.Process
// method.
type LogField struct {
	key          string
	valType      valType
	numericVal   int64
	stringVal    string
	interfaceVal interface{}
}

func LogString(key, val string) LogField {
	return LogField{
		key:       key,
		valType:   stringType,
		stringVal: val,
	}
}

func LogBool(key string, val bool) LogField {
	var numericVal int64
	if val {
		numericVal = 1
	}
	return LogField{
		key:        key,
		valType:    boolType,
		numericVal: numericVal,
	}
}
<commit_msg>Give credit where credit is due<commit_after>package opentracing

import "math"

const (
	stringType fieldType = iota
	boolType
	intType
	int64Type
	float64Type
	errorType
	objectType
	deferredObjectType
)

// LogField instances are constructed via LogBool, LogString, and so on.
// Tracing implementations may then handle them via the LogField.Process
// method.
//
// "heavily influenced by" (i.e., partially stolen from)
// https://github.com/uber-go/zap
type LogField struct {
	key          string
	valType      valType
	numericVal   int64
	stringVal    string
	interfaceVal interface{}
}

func LogString(key, val string) LogField {
	return LogField{
		key:       key,
		valType:   stringType,
		stringVal: val,
	}
}

func LogBool(key string, val bool) LogField {
	var numericVal int64
	if val {
		numericVal = 1
	}
	return LogField{
		key:        key,
		valType:    boolType,
		numericVal: numericVal,
	}
}

{'fraction_non_alphanumeric': 0.07242990654205607, 'fraction_numerical': 0.010514018691588784, 'mean_word_length': 3.293233082706767, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, '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': '3890525', 'n_tokens_mistral': 595, 'n_tokens_neox': 565, 'n_words': 177}