<commit_before>package logger

import (
	"github.com/op/go-logging"
	"koding/tools/config"
)

// Stores current logging level.
var loggingLevel logging.Level

// Mappings of strings in config file to internal types.
var nameToLevelMapping = map[string]logging.Level{
	"debug":   logging.DEBUG,
	"warning": logging.WARNING,
	"error":   logging.ERROR,
}

var defaultLoggingLevel = logging.WARNING

// Get logging level from config file & find the appropriate logging.Level
func getLoggingLevelFromConfig(name string) logging.Level {
	var logLevelString, ok = config.Current.LogLevel[name]
	if !ok {
		return defaultLoggingLevel
	}

	loggingLevel, ok = nameToLevelMapping[logLevelString]
	if !ok {
		return defaultLoggingLevel
	}

	return loggingLevel
}<commit_msg>logger: add more levels<commit_after>package logger

import (
	"github.com/op/go-logging"
	"koding/tools/config"
)

// Stores current logging level.
var loggingLevel logging.Level

// Mappings of strings in config file to internal types.
var nameToLevelMapping = map[string]logging.Level{
	"critical": logging.CRITICAL,
	"debug":    logging.DEBUG,
	"error":    logging.ERROR,
	"info":     logging.INFO,
	"notice":   logging.NOTICE,
	"warning":  logging.WARNING,
}

var defaultLoggingLevel = logging.WARNING

// Get logging level from config file & find the appropriate logging.Level
func getLoggingLevelFromConfig(name string) logging.Level {
	var logLevelString, ok = config.Current.LogLevel[name]
	if !ok {
		return defaultLoggingLevel
	}

	loggingLevel, ok = nameToLevelMapping[logLevelString]
	if !ok {
		return defaultLoggingLevel
	}

	return loggingLevel
}
{'fraction_non_alphanumeric': 0.0960591133004926, 'fraction_numerical': 0.0, 'mean_word_length': 4.662020905923345, 'pattern_counts': {'":': 9, '<': 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': '7540568', 'n_tokens_mistral': 509, 'n_tokens_neox': 496, 'n_words': 137}