<commit_before>package main

import (
    "flag"
    "fmt"
    "log"
    "net/http"
    "os"
    lib "github.com/johnny-morrice/godelbrot/libgodelbrot"
    "github.com/johnny-morrice/godelbrot/rest"
)

type params struct {
    jobs uint
    port uint
    bind string
    debug bool
}

func main() {
    args := readArgs()
    info, readerr := lib.ReadInfo(os.Stdin)
    if readerr != nil {
        log.Printf("Info read error: %v", readerr)
    }

    const prefix = "/"
    h := rest.MakeWebservice(info, args.jobs, prefix)
    if args.debug {
        log.Println("Running in debug mode")
        h = loghandler{handler: h}
    }
    addr := fmt.Sprintf("%v:%v", args.bind, args.port)
    httperr := http.ListenAndServe(addr, h)
    if httperr != nil {
        log.Fatal(httperr)
    }<commit_msg>Enable library debug mode on app debug mode<commit_after>package main

import (
    "flag"
    "fmt"
    "log"
    "net/http"
    "os"
    lib "github.com/johnny-morrice/godelbrot/libgodelbrot"
    "github.com/johnny-morrice/godelbrot/rest"
)

type params struct {
    jobs uint
    port uint
    bind string
    debug bool
}

func main() {
    args := readArgs()
    info, readerr := lib.ReadInfo(os.Stdin)
    if readerr != nil {
        log.Printf("Info read error: %v", readerr)
    }

    const prefix = "/"
    h := rest.MakeWebservice(info, args.jobs, prefix)
    if args.debug {
        log.Println("Running in debug mode")
        h = loghandler{handler: h}
        rest.Debug()
    }
    addr := fmt.Sprintf("%v:%v", args.bind, args.port)
    httperr := http.ListenAndServe(addr, h)
    if httperr != nil {
        log.Fatal(httperr)
    }
{'fraction_non_alphanumeric': 0.13418336369156042, 'fraction_numerical': 0.0, 'mean_word_length': 2.377049180327869, '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': '1330588', 'n_tokens_mistral': 600, 'n_tokens_neox': 586, 'n_words': 134}