<commit_before>/*
Package spec provides a Logger for applications to use and write logs with.

The Logger can be used like so:

	import "github.com/skuid/spec"
	import "github.com/uber-go/zap"

	var logger spec.Logger

	func main() {
		logger.Debug("A debug message")
		logger.Info("An info message")
		logger.Info(
			"An info message with values",
			zap.String("key", "value"),
		)
		logger.Error("An error message")

		err := errors.New("some error")
		logger.Error("An error message", zap.Error(err))
	}

*/
package spec

import (
	"go.uber.org/zap"
	"go.uber.org/zap/zapcore"
)

//Logger is a zap.Logger that can be set to the same logger you've created
var Logger *zap.Logger

//NewStandardLogger creates a new zap.Logger based on common configuration
func NewStandardLogger() (l *zap.Logger, err error) {
	config := zap.Config{
		Level:       zap.NewAtomicLevel(),
		Development: false,
		Sampling: &zap.SamplingConfig{
			Initial:    100,
			Thereafter: 100,
		},
		Encoding: "json",
		EncoderConfig: zapcore.EncoderConfig{
			TimeKey:        "timestamp",
			LevelKey:       "level",
			NameKey:        "logger",
			CallerKey:      "caller",
			MessageKey:     "message",
			StacktraceKey:  "stacktrace",
			EncodeLevel:    zapcore.LowercaseLevelEncoder,
			EncodeTime:     zapcore.ISO8601TimeEncoder,
			EncodeDuration: zapcore.SecondsDurationEncoder,
		},
		OutputPaths:      []string{"stdout"},
		ErrorOutputPaths: []string{"stderr"},
	}

	return config.Build()
}<commit_msg>Added EncodeCaller to EncoderConfig<commit_after>/*
Package spec provides a Logger for applications to use and write logs with.

The Logger can be used like so:

	import "github.com/skuid/spec"
	import "github.com/uber-go/zap"

	var logger spec.Logger

	func main() {
		logger.Debug("A debug message")
		logger.Info("An info message")
		logger.Info(
			"An info message with values",
			zap.String("key", "value"),
		)
		logger.Error("An error message")

		err := errors.New("some error")
		logger.Error("An error message", zap.Error(err))
	}

*/
package spec

import (
	"go.uber.org/zap"
	"go.uber.org/zap/zapcore"
)

//Logger is a zap.Logger that can be set to the same logger you've created
var Logger *zap.Logger

//NewStandardLogger creates a new zap.Logger based on common configuration
func NewStandardLogger() (l *zap.Logger, err error) {
	config := zap.Config{
		Level:       zap.NewAtomicLevel(),
		Development: false,
		Sampling: &zap.SamplingConfig{
			Initial:    100,
			Thereafter: 100,
		},
		Encoding: "json",
		EncoderConfig: zapcore.EncoderConfig{
			TimeKey:        "timestamp",
			LevelKey:       "level",
			NameKey:        "logger",
			CallerKey:      "caller",
			MessageKey:     "message",
			StacktraceKey:  "stacktrace",
			EncodeLevel:    zapcore.LowercaseLevelEncoder,
			EncodeTime:     zapcore.ISO8601TimeEncoder,
			EncodeDuration: zapcore.SecondsDurationEncoder,
			EncodeCaller:   zapcore.ShortCallerEncoder,
		},
		OutputPaths:      []string{"stdout"},
		ErrorOutputPaths: []string{"stderr"},
	}

	return config.Build()
}
{'fraction_non_alphanumeric': 0.12257640486362142, 'fraction_numerical': 0.006572461386789352, 'mean_word_length': 3.5705705705705704, '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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6279737', 'n_tokens_mistral': 1096, 'n_tokens_neox': 995, 'n_words': 267}