diff options
author | Nick White <git@njw.name> | 2019-09-03 10:42:16 +0100 |
---|---|---|
committer | Nick White <git@njw.name> | 2019-09-03 11:54:17 +0100 |
commit | 843ddbb9854ff222ffcf9b9269e5a089499b41e3 (patch) | |
tree | e00d09ad92510e6db7ff08c150e6b81dbbfce04d /bookpipeline/cmd | |
parent | 7d1bee088d0d3d2014dadc03a42a5b3adb3cf7e4 (diff) |
Improve debug logging
Diffstat (limited to 'bookpipeline/cmd')
-rw-r--r-- | bookpipeline/cmd/bookpipeline/main.go | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/bookpipeline/cmd/bookpipeline/main.go b/bookpipeline/cmd/bookpipeline/main.go index 672250a..44b6ca6 100644 --- a/bookpipeline/cmd/bookpipeline/main.go +++ b/bookpipeline/cmd/bookpipeline/main.go @@ -86,7 +86,7 @@ func up(c chan string, done chan bool, conn Pipeliner, bookname string, errc cha for path := range c { name := filepath.Base(path) key := filepath.Join(bookname, name) - logger.Println("Downloading", key) + logger.Println("Uploading", key) err := conn.Upload(conn.WIPStorageId(), key, path) if err != nil { errc <- err @@ -274,7 +274,7 @@ func processBook(msg bookpipeline.Qmsg, conn Pipeliner, process func(chan string } if toQueue != "" { - conn.GetLogger().Println("Sending", bookname, "to queue") + conn.GetLogger().Println("Sending", bookname, "to queue", toQueue) err = conn.AddToQueue(toQueue, bookname) if err != nil { t.Stop() @@ -285,7 +285,7 @@ func processBook(msg bookpipeline.Qmsg, conn Pipeliner, process func(chan string t.Stop() - conn.GetLogger().Println("Deleting original message from queue") + conn.GetLogger().Println("Deleting original message from queue", fromQueue) err = conn.DelFromQueue(fromQueue, msg.Handle) if err != nil { _ = os.RemoveAll(d) @@ -351,6 +351,7 @@ func main() { verboselog.Println("No message received on preprocess queue, sleeping") continue } + verboselog.Println("Message received on preprocess queue, processing", msg.Body) err = processBook(msg, conn, preprocess, origPattern, conn.PreQueueId(), conn.OCRQueueId()) if err != nil { log.Println("Error during preprocess", err) @@ -366,6 +367,7 @@ func main() { verboselog.Println("No message received on OCR queue, sleeping") continue } + verboselog.Println("Message received on OCR queue, processing", msg.Body) err = processBook(msg, conn, ocr(*training), preprocessedPattern, conn.OCRQueueId(), conn.AnalyseQueueId()) if err != nil { log.Println("Error during OCR process", err) @@ -381,6 +383,7 @@ func main() { verboselog.Println("No message received on analyse queue, sleeping") continue } + verboselog.Println("Message received on analyse queue, processing", msg.Body) err = processBook(msg, conn, analyse, ocredPattern, conn.AnalyseQueueId(), "") if err != nil { log.Println("Error during analysis", err) |