From 4d3bc1ed40376e79a70b2aabca08b99650f155d5 Mon Sep 17 00:00:00 2001 From: Yannick Ulrich Date: Tue, 21 Feb 2023 20:12:10 +0000 Subject: [PATCH] y 1a5970a --- fuse/main.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/fuse/main.go b/fuse/main.go index 18c8052..094c2ca 100644 --- a/fuse/main.go +++ b/fuse/main.go @@ -1,6 +1,7 @@ package main import ( + "go.arsenm.dev/logger" "go.arsenm.dev/logger/log" "os" "context" @@ -241,7 +242,7 @@ type bytesFileWriteHandle struct { var _ = (fs.FileWriter)((*bytesFileWriteHandle)(nil)) func (fh *bytesFileWriteHandle) Write(ctx context.Context, data []byte, off int64) (written uint32, errno syscall.Errno) { - log.Info("Executing Write").Str("path", fh.path).Int("size", len(fh.content)).Send() + log.Info("Executing Write").Str("path", fh.path).Int("prev_size", len(fh.content)).Int("next_size", len(data)).Send() if off != int64(len(fh.content)) { } fh.content = append(fh.content[:], data[:]...) @@ -483,6 +484,11 @@ func (f *ITNode) Rmdir(ctx context.Context, name string) syscall.Errno { return f.Unlink(ctx, name) } +func init() { + // Default logger is JSONLogger going to stderr + log.Logger = logger.NewPretty(os.Stdout) +} + func main() { // This is where we'll mount the FS mntDir := "/tmp/x"