fs/cmd/torrentfs/main.go | 6 +++++- diff --git a/fs/cmd/torrentfs/main.go b/fs/cmd/torrentfs/main.go index bee151cba1ef1a1f30eb4dd35f8ad99b3ef8b38b..3ebdc281d6cb41bd8296c309665298f24a68ea25 100644 --- a/fs/cmd/torrentfs/main.go +++ b/fs/cmd/torrentfs/main.go @@ -25,6 +25,8 @@ torrentfs "github.com/anacrolix/torrent/fs" "github.com/anacrolix/torrent/util/dirwatch" ) +var logger = log.Default.WithNames("main") + var args = struct { MetainfoDir string `help:"torrent files in this location describe the contents of the mounted filesystem"` DownloadDir string `help:"location to save torrent data"` @@ -71,7 +73,7 @@ func main() { defer envpprof.Stop() err := mainErr() if err != nil { - log.Printf("error in main: %v", err) + logger.Levelf(log.Error, "error in main: %v", err) os.Exit(1) } } @@ -143,9 +145,11 @@ } }() } + logger.Levelf(log.Debug, "serving fuse fs") if err := fusefs.Serve(conn, fs); err != nil { return fmt.Errorf("serving fuse fs: %w", err) } + logger.Levelf(log.Debug, "fuse fs completed successfully. waiting for conn ready") <-conn.Ready if err := conn.MountError; err != nil { return fmt.Errorf("mount error: %w", err)