mirror of
https://github.com/rclone/rclone.git
synced 2025-11-23 21:44:49 +02:00
As shown in
81e56a30c8/log.go (L74)
it seems like the wanted behaviour for merging arguments is the one of PrintLn,
which is "put a space between each arg"
36 lines
565 B
Go
36 lines
565 B
Go
package s3
|
|
|
|
import (
|
|
"fmt"
|
|
"strings"
|
|
|
|
"github.com/rclone/gofakes3"
|
|
"github.com/rclone/rclone/fs"
|
|
)
|
|
|
|
// logger output formatted message
|
|
type logger struct{}
|
|
|
|
// print log message
|
|
func (l logger) Print(level gofakes3.LogLevel, v ...any) {
|
|
var b strings.Builder
|
|
for i := range v {
|
|
if i > 0 {
|
|
fmt.Fprintf(&b, " ")
|
|
}
|
|
fmt.Fprint(&b, v[i])
|
|
}
|
|
s := b.String()
|
|
|
|
switch level {
|
|
default:
|
|
fallthrough
|
|
case gofakes3.LogErr:
|
|
fs.Errorf("serve s3", s)
|
|
case gofakes3.LogWarn:
|
|
fs.Infof("serve s3", s)
|
|
case gofakes3.LogInfo:
|
|
fs.Debugf("serve s3", s)
|
|
}
|
|
}
|