This commit is contained in:
Yannick Ulrich 2023-02-21 20:12:10 +00:00
parent 68f6d20719
commit 4d3bc1ed40
1 changed files with 7 additions and 1 deletions

View File

@ -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"