mirror of
https://github.com/rclone/rclone
synced 2024-12-23 14:23:44 +01:00
bcdfad3c83
This changes log statements from log to fs package, which is required for --use-json-log to properly make log output in JSON format. The recently added custom linting rule, handled by ruleguard via gocritic via golangci-lint, warns about these and suggests the alternative. Fixing was therefore basically running "golangci-lint run --fix", although some manual fixup of mainly imports are necessary following that.
24 lines
434 B
Go
24 lines
434 B
Go
//go:build darwin || freebsd || netbsd || dragonfly || openbsd
|
|
|
|
package cmd
|
|
|
|
import (
|
|
"os"
|
|
"os/signal"
|
|
"syscall"
|
|
|
|
"github.com/rclone/rclone/fs"
|
|
"github.com/rclone/rclone/fs/accounting"
|
|
)
|
|
|
|
// SigInfoHandler creates SigInfo handler
|
|
func SigInfoHandler() {
|
|
signals := make(chan os.Signal, 1)
|
|
signal.Notify(signals, syscall.SIGINFO)
|
|
go func() {
|
|
for range signals {
|
|
fs.Printf(nil, "%v\n", accounting.GlobalStats())
|
|
}
|
|
}()
|
|
}
|