From 2cf7e80480e0b67ccbddcbc21b2b038ef99d0f4d Mon Sep 17 00:00:00 2001 From: "Alexander \"Arav\" Andreev" Date: Fri, 1 Jul 2022 03:32:12 +0400 Subject: [PATCH] Instantiate a logDelete in main. --- cmd/dwelling-upload/main.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cmd/dwelling-upload/main.go b/cmd/dwelling-upload/main.go index 1594f16..6693991 100644 --- a/cmd/dwelling-upload/main.go +++ b/cmd/dwelling-upload/main.go @@ -60,6 +60,12 @@ func main() { } defer logDownload.Close() + logDelete, err := logging.NewLogger(config.Log.Delete, config.Log.ToStdout) + if err != nil { + log.Fatalln("delete logger:", err) + } + defer logDelete.Close() + watcha, err := watcher.NewInotifyWatcher() if err != nil { logErr.Fatalln(err) @@ -78,7 +84,7 @@ func main() { watcha.WatchForMask(uploadDirNotify, watcher.CrDelMask) - hand := handlers.NewUploadHandlers(config, logErr, logUpload, logDownload, &uploadDirSize) + hand := handlers.NewUploadHandlers(config, logErr, logUpload, logDownload, logDelete, &uploadDirSize) srv := server.NewHttpServer() srv.SetNotFoundHandler(hand.NotFound)