File size: 661 Bytes
7107f0b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Credits: https://pkg.go.dev/github.com/rclone/[email protected]/cmd/serve/s3
// Package s3 implements a fake s3 server for alist
package s3

import (
	"fmt"

	"github.com/Mikubill/gofakes3"
	"github.com/alist-org/alist/v3/pkg/utils"
)

// logger output formatted message
type logger struct{}

// print log message
func (l logger) Print(level gofakes3.LogLevel, v ...interface{}) {
	switch level {
	default:
		fallthrough
	case gofakes3.LogErr:
		utils.Log.Errorf("serve s3: %s", fmt.Sprintln(v...))
	case gofakes3.LogWarn:
		utils.Log.Infof("serve s3: %s", fmt.Sprintln(v...))
	case gofakes3.LogInfo:
		utils.Log.Debugf("serve s3: %s", fmt.Sprintln(v...))
	}
}