<commit_before>package main

import (
	"flag"
	"os"
	"strconv"

	"github.com/emwalker/digraph/cmd/frontend/server"
	// Load the PQ drivers
	_ "github.com/lib/pq"
)

const defaultPort = "8080"

func getPlaygroundPort() string {
	port := os.Getenv("PORT")
	if port == "" {
		port = defaultPort
	}
	return port
}

func getLogLevel(logLevel int) int {
	str := os.Getenv("DIGRAPH_LOG_LEVEL")
	if str != "" {
		i, err := strconv.Atoi(str)
		if err != nil {
			return logLevel
		}
		logLevel = i
	}
	return logLevel
}

func main() {
	devMode := flag.Bool("dev", false, "Development mode")
	logLevel := flag.Int("log", 1, "Print debugging information to the console")

	flag.Parse()
<commit_msg>Provide diagnostic logging for setting DIGRAPH_LOG_LEVEL<commit_after>package main

import (
	"flag"
	"log"
	"os"
	"strconv"

	"github.com/emwalker/digraph/cmd/frontend/server"
	// Load the PQ drivers
	_ "github.com/lib/pq"
)

const defaultPort = "8080"

func getPlaygroundPort() string {
	port := os.Getenv("PORT")
	if port == "" {
		port = defaultPort
	}
	return port
}

func getLogLevel(logLevel int) int {
	str := os.Getenv("DIGRAPH_LOG_LEVEL")
	if str != "" {
		log.Print("DIGRAPH_LOG_LEVEL found, overriding the command line flag")
		i, err := strconv.Atoi(str)
		if err != nil {
			log.Printf("Unable to parse DIGRAPH_LOG_LEVEL: %s", err)
			return logLevel
		}
		logLevel = i
	} else {
		log.Print("No DIGRAPH_LOG_LEVEL found, falling back to the command line flag")
	}
	return logLevel
}

func main() {
	devMode := flag.Bool("dev", false, "Development mode")
	logLevel := flag.Int("log", 1, "Print debugging information to the console")

	flag.Parse()

{'fraction_non_alphanumeric': 0.1395631067961165, 'fraction_numerical': 0.006067961165048544, 'mean_word_length': 3.9223880597014924, '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': '5596039', 'n_tokens_mistral': 662, 'n_tokens_neox': 609, 'n_words': 156}