diff --git a/internal/images/fastjpeg/fastjpeg.go b/internal/images/fastjpeg/fastjpeg.go index a6e452881..bdc1ddaf0 100644 --- a/internal/images/fastjpeg/fastjpeg.go +++ b/internal/images/fastjpeg/fastjpeg.go @@ -78,16 +78,17 @@ var ( func Available() bool { checkAvailability.Do(func() { if ok, _ := strconv.ParseBool(os.Getenv("CAMLI_DISABLE_DJPEG")); ok { - log.Println("CAMLI_DISABLE_DJPEG set in environment. Disabling fastjpeg.") + log.Println("images/fastjpeg: CAMLI_DISABLE_DJPEG set in environment; disabling fastjpeg.") return } if p, err := exec.LookPath(djpegBin); p != "" && err == nil { available = true - log.Printf("fastjpeg enabled with %s.", p) + log.Printf("images/fastjpeg: fastjpeg enabled with %s.", p) } if !available { - log.Printf("%s not found in PATH, disabling fastjpeg.", djpegBin) + // TODO: also use Docker. https://github.com/perkeep/perkeep/issues/1106. + log.Printf("images/fastjpeg: %s not found in PATH, disabling fastjpeg.", djpegBin) } }) diff --git a/pkg/importer/importer.go b/pkg/importer/importer.go index 815cc1192..509ec39f1 100644 --- a/pkg/importer/importer.go +++ b/pkg/importer/importer.go @@ -729,7 +729,7 @@ func (ia *importerAcct) maybeStart() { } go func() { if err := lp.LongPoll(rc); err == nil { - log.Printf("Long poll for %s found an update. Starting run...", ia) + log.Printf("importer: long poll for %s found an update. Starting run...", ia) timer.Stop() ia.start() } else { @@ -740,7 +740,7 @@ func (ia *importerAcct) maybeStart() { return } - log.Printf("Starting regular periodic import for %v", ia) + log.Printf("importer: starting periodic import for %v", ia) go ia.start() } diff --git a/pkg/index/corpus.go b/pkg/index/corpus.go index 4938786cf..ebdaacf6d 100644 --- a/pkg/index/corpus.go +++ b/pkg/index/corpus.go @@ -573,7 +573,7 @@ func (c *Corpus) scanPrefix(mu *sync.Mutex, s sorted.KeyValue, prefix string) (e } if logCorpusStats { d := time.Since(t0) - c.logf("scanned prefix %q: %d rows, %v", prefix[:len(prefix)-1], n, d) + c.logf("loaded prefix %q: %d rows, %v", prefix[:len(prefix)-1], n, d) } return nil } diff --git a/pkg/search/websocket.go b/pkg/search/websocket.go index 276095b82..6dc1ba7a4 100644 --- a/pkg/search/websocket.go +++ b/pkg/search/websocket.go @@ -22,6 +22,8 @@ import ( "encoding/json" "log" "net/http" + "os" + "strconv" "sync" "time" @@ -42,6 +44,8 @@ const ( maxMessageSize = 10 << 10 ) +var debug, _ = strconv.ParseBool(os.Getenv("CAMLI_DEBUG")) + type wsHub struct { sh *Handler register chan *wsConn @@ -118,7 +122,9 @@ func (h *wsHub) run() { q: wr.q, } wr.conn.queries[wr.tag] = wq - log.Printf("Added/updated search subscription for tag %q", wr.tag) + if debug { + log.Printf("websocket: added/updated search subscription for tag %q", wr.tag) + } go h.doSearch(wq) case wq := <-h.updatedResults: @@ -247,7 +253,9 @@ func (c *wsConn) readPump() { if err != nil { break } - log.Printf("Got websocket message %#q", message) + if debug { + log.Printf("websocket: got message %#q", message) + } cm := new(wsClientMessage) if err := json.Unmarshal(message, cm); err != nil { log.Printf("Ignoring bogus websocket message. Err: %v", err)