<commit_before>package outflux

import (
	"fmt"
	"io"
	"log"
)

type Logger interface {
	Print(...interface{})
}

var Log Logger

// stdlog is an empty struct that represents logging from the standard, global logger.
type stdlog struct{}

func (stdlog) Print(args ...interface{}) { log.Print(args...) }

// Stdlog is a Logger that uses the standard log package's logger.
var Stdlog = stdlog{}

func logf(format string, args ...interface{}) {
	if Log == nil {
		return
	}

	Log.Print("outflux: ", fmt.Sprintf(format, args...))
}

func logclose(c io.Closer) error {
	err := c.Close()
	if err != nil {
		logf("Error closing %T: %v", c, err)
	}
	return err
}<commit_msg>godoc comments for log.go<commit_after>package outflux

import (
	"fmt"
	"io"
	"log"
)

// Logger is a basic logging interface that outflux uses to handle its logging behavior. You can set the logger by
// modifying the Log package variable. This is not safe for concurrent modification by virtue of it being a package
// variable, so you should only set it once at program startup, before you've given outflux a reason to log anything.
type Logger interface {
	Print(...interface{})
}

// Log is the Logger used by outflux. If nil, outflux will not log anything. All outflux log messages are prefixed with
// "outflux: " to identify them.
var Log Logger

// stdlog is an empty struct that represents logging from the standard, global logger.
type stdlog struct{}

func (stdlog) Print(args ...interface{}) { log.Print(args...) }

// Stdlog is a Logger that uses the standard log package's logger.
var Stdlog = stdlog{}

func logf(format string, args ...interface{}) {
	if Log == nil {
		return
	}

	Log.Print("outflux: ", fmt.Sprintf(format, args...))
}

func logclose(c io.Closer) error {
	err := c.Close()
	if err != nil {
		logf("Error closing %T: %v", c, err)
	}
	return err
}
{'fraction_non_alphanumeric': 0.12242686890574214, 'fraction_numerical': 0.0, 'mean_word_length': 3.560493827160494, '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': '5674038', 'n_tokens_mistral': 598, 'n_tokens_neox': 575, 'n_words': 241}