2022-09-21 17:09:50 +02:00
|
|
|
package s3
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
|
2024-04-13 18:50:11 +02:00
|
|
|
"github.com/rclone/gofakes3"
|
2022-09-21 17:09:50 +02: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 12:50:13 +02:00
|
|
|
default:
|
|
|
|
fallthrough
|
2022-09-21 17:09:50 +02:00
|
|
|
case gofakes3.LogErr:
|
2023-09-12 12:50:13 +02:00
|
|
|
fs.Errorf("serve s3", fmt.Sprintln(v...))
|
2022-09-21 17:09:50 +02:00
|
|
|
case gofakes3.LogWarn:
|
2023-09-12 12:50:13 +02:00
|
|
|
fs.Infof("serve s3", fmt.Sprintln(v...))
|
2022-09-21 17:09:50 +02:00
|
|
|
case gofakes3.LogInfo:
|
2023-09-12 12:50:13 +02:00
|
|
|
fs.Debugf("serve s3", fmt.Sprintln(v...))
|
2022-09-21 17:09:50 +02:00
|
|
|
}
|
|
|
|
}
|