2022-09-21 23:09:50 +08:00
|
|
|
package s3
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
|
2024-04-14 00:50:11 +08:00
|
|
|
"github.com/rclone/gofakes3"
|
2022-09-21 23:09:50 +08:00
|
|
|
"github.com/rclone/rclone/fs"
|
|
|
|
)
|
|
|
|
|
|
|
|
// logger output formatted message
|
|
|
|
type logger struct{}
|
|
|
|
|
|
|
|
// print log message
|
|
|
|
func (l logger) Print(level gofakes3.LogLevel, v ...interface{}) {
|
|
|
|
switch level {
|
2023-09-12 18:50:13 +08:00
|
|
|
default:
|
|
|
|
fallthrough
|
2022-09-21 23:09:50 +08:00
|
|
|
case gofakes3.LogErr:
|
2023-09-12 18:50:13 +08:00
|
|
|
fs.Errorf("serve s3", fmt.Sprintln(v...))
|
2022-09-21 23:09:50 +08:00
|
|
|
case gofakes3.LogWarn:
|
2023-09-12 18:50:13 +08:00
|
|
|
fs.Infof("serve s3", fmt.Sprintln(v...))
|
2022-09-21 23:09:50 +08:00
|
|
|
case gofakes3.LogInfo:
|
2023-09-12 18:50:13 +08:00
|
|
|
fs.Debugf("serve s3", fmt.Sprintln(v...))
|
2022-09-21 23:09:50 +08:00
|
|
|
}
|
|
|
|
}
|