Skip to content

Commit

Permalink
chore: logging
Browse files Browse the repository at this point in the history
  • Loading branch information
neurosnap committed Aug 17, 2024
1 parent d0972f2 commit 2551cf3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ func (h *UploadAssetHandler) GetLogger() *slog.Logger {
}

func (h *UploadAssetHandler) Delete(s ssh.Session, entry *utils.FileEntry) error {
h.Cfg.Logger.Info("deleting file", "file", entry.Filepath)
bucket, err := getBucket(s.Context())
if err != nil {
h.Cfg.Logger.Error(err.Error())
Expand All @@ -83,6 +84,7 @@ func (h *UploadAssetHandler) Read(s ssh.Session, entry *utils.FileEntry) (os.Fil
FSize: entry.Size,
FModTime: time.Unix(entry.Mtime, 0),
}
h.Cfg.Logger.Info("reading file", "file", fileInfo)

bucketName := h.Cfg.AssetNames.BucketName(s.User())
bucket, err := h.Cfg.Storage.GetBucket(bucketName)
Expand All @@ -105,6 +107,12 @@ func (h *UploadAssetHandler) Read(s ssh.Session, entry *utils.FileEntry) (os.Fil
}

func (h *UploadAssetHandler) List(s ssh.Session, fpath string, isDir bool, recursive bool) ([]os.FileInfo, error) {
h.Cfg.Logger.Info(
"listing path",
"dir", fpath,
"isDir", isDir,
"recursive", recursive,
)
var fileList []os.FileInfo
userName := s.User()

Expand Down

0 comments on commit 2551cf3

Please sign in to comment.