Start to add zap logger everywhere
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/debridmediamanager.com/zurg/pkg/logutil"
|
||||
"gopkg.in/yaml.v3"
|
||||
)
|
||||
|
||||
@@ -19,10 +20,14 @@ type ConfigInterface interface {
|
||||
MeetsConditions(directory, torrentID, torrentName string, fileNames []string) bool
|
||||
GetOnLibraryUpdate() string
|
||||
GetNetworkBufferSize() int
|
||||
GetMountPath() string
|
||||
GetMountPoint() string
|
||||
}
|
||||
|
||||
func LoadZurgConfig(filename string) (ConfigInterface, error) {
|
||||
rlog := logutil.NewLogger()
|
||||
log := rlog.Named("config")
|
||||
|
||||
log.Debug("Loading config file", filename)
|
||||
content, err := os.ReadFile(filename)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -35,6 +40,7 @@ func LoadZurgConfig(filename string) (ConfigInterface, error) {
|
||||
|
||||
switch initialConfig.Version {
|
||||
case "v1":
|
||||
log.Debug("Detected config version: v1")
|
||||
return loadV1Config(content)
|
||||
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user