<commit_before>package main

import (
	"flag"
	"log"
	"os"
	"os/signal"
	"os/user"
	"syscall"
	"time"

	"github.com/mdlayher/wavepipe/core"
)

// testFlag invokes wavepipe in "test" mode, where it will start and exit shortly after.  Used for testing.
var testFlag = flag.Bool("test", false, "Starts "+core.App+" in test mode, causing it to exit shortly after starting.")

func main() {
	// Set up logging, parse flags
	log.SetFlags(log.Ldate | log.Ltime | log.Lshortfile)
	flag.Parse()

	// Check if wavepipe was invoked as root (which is a really bad idea)
	currUser, err := user.Current()
	if err != nil {
		log.Fatal(core.App, ": could not determine current user, exiting")
	}

	// Check for root, notify user if so
	if currUser.Uid == "0" || currUser.Gid == "0" || currUser.Username == "root" {
		log.Println(core.App, ": WARNING, it is NOT advisable to run wavepipe as root!")
	}

	// Set configuration path
	core.ConfigPath = currUser.HomeDir + "/.config/wavepipe/wavepipe.json"

	// Application entry point
	log.Println(core.App, ": starting...")

	// Check if running in debug mode, which will allow bypass of certain features such as
	// API authentication.  USE THIS FOR DEVELOPMENT ONLY!
	if os.Getenv("WAVEPIPE_DEBUG") == "1" {
		log.Println(core.App, ": WARNING, running in debug mode; authentication disabled!")
	}

	// Gracefully handle termination via UNIX signal
	sigChan := make(chan os.Signal, 1)<commit_msg>Only print filename in logs in debug mode<commit_after>package main

import (
	"flag"
	"log"
	"os"
	"os/signal"
	"os/user"
	"syscall"
	"time"

	"github.com/mdlayher/wavepipe/core"
)

// testFlag invokes wavepipe in "test" mode, where it will start and exit shortly after.  Used for testing.
var testFlag = flag.Bool("test", false, "Starts "+core.App+" in test mode, causing it to exit shortly after starting.")

func main() {
	// Use more verbose logging in debug mode
	if os.Getenv("WAVEPIPE_DEBUG") == "1" {
		log.SetFlags(log.Ldate | log.Ltime | log.Lshortfile)
	}

	// Parse command line flags
	flag.Parse()

	// Check if wavepipe was invoked as root (which is a really bad idea)
	currUser, err := user.Current()
	if err != nil {
		log.Fatal(core.App, ": could not determine current user, exiting")
	}

	// Check for root, notify user if so
	if currUser.Uid == "0" || currUser.Gid == "0" || currUser.Username == "root" {
		log.Println(core.App, ": WARNING, it is NOT advisable to run wavepipe as root!")
	}

	// Set configuration path
	core.ConfigPath = currUser.HomeDir + "/.config/wavepipe/wavepipe.json"

	// Application entry point
	log.Println(core.App, ": starting...")

	// Check if running in debug mode, which will allow bypass of certain features such as
	// API authentication.  USE THIS FOR DEVELOPMENT ONLY!
	if os.Getenv("WAVEPIPE_DEBUG") == "1" {
		log.Println(core.App, ": WARNING, running in debug mode; authentication disabled!")
	}

	// Gracefully handle termination via UNIX signal
	sigChan := make(chan os.Signal, 1)
{'fraction_non_alphanumeric': 0.1307277628032345, 'fraction_numerical': 0.003032345013477089, 'mean_word_length': 3.7201907790143083, 'pattern_counts': {'":': 8, '<': 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': '427327', 'n_tokens_mistral': 1020, 'n_tokens_neox': 983, 'n_words': 335}