<commit_before>package log

import "io"
import "sync"

type Sink interface {
	Log(*Record)
	Flush()
	IsEnabled(*Metadata) bool
}

type NopSink struct{}

func (NopSink) Log(*Record) {
}

func (NopSink) Flush() {
}
func (NopSink) IsEnabled(*Metadata) bool {
	return false
}

type LeveledSink struct {
	MaxLevel Level
	Target   Sink
}

func (l *LeveledSink) Log(r *Record) {
	l.Target.Log(r)
}

func (l *LeveledSink) Flush() {
}

func (l *LeveledSink) IsEnabled(m *Metadata) bool {
	return m.Level <= l.MaxLevel
}
<commit_msg>change: better consistency with inner sinks naming<commit_after>package log

import "io"
import "sync"

type Sink interface {
	Log(*Record)
	Flush()
	IsEnabled(*Metadata) bool
}

type NopSink struct{}

func (NopSink) Log(*Record) {
}

func (NopSink) Flush() {
}
func (NopSink) IsEnabled(*Metadata) bool {
	return false
}

type LeveledSink struct {
	MaxLevel Level
	Inner    Sink
}

func (l *LeveledSink) Log(r *Record) {
	l.Inner.Log(r)
}

func (l *LeveledSink) Flush() {
}

func (l *LeveledSink) IsEnabled(m *Metadata) bool {
	return m.Level <= l.MaxLevel
}

{'fraction_non_alphanumeric': 0.13401109057301294, 'fraction_numerical': 0.0, 'mean_word_length': 4.525510204081633, 'pattern_counts': {'":': 0, '<': 5, '<?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': '6146301', 'n_tokens_mistral': 420, 'n_tokens_neox': 433, 'n_words': 114}