X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=lib%2Fxdsconfig%2Fconfig.go;h=16390ae82e9328a25260b2b997f561f5f9f6aee3;hb=2d3f1be6a495143d7e82f6396a49dfff6cabc3e4;hp=b7bf57be341a3b0b88d44cc7ea47f9cfe83eaf58;hpb=a2cc38902ff7528870822110c4f04329a3918564;p=src%2Fxds%2Fxds-agent.git diff --git a/lib/xdsconfig/config.go b/lib/xdsconfig/config.go index b7bf57b..16390ae 100644 --- a/lib/xdsconfig/config.go +++ b/lib/xdsconfig/config.go @@ -91,6 +91,12 @@ func Init(ctx *cli.Context, log *logrus.Logger) (*Config, error) { SThgConf: &SyncThingConf{ Home: defaultSTHomeDir, }, + ProfileConf: ProfileConfT{ + XDSBinder: XDSBinderConf{ + URL: "http://localhost:8810", + ConnRetry: 10, + }, + }, }, Log: log, } @@ -106,11 +112,18 @@ func Init(ctx *cli.Context, log *logrus.Logger) (*Config, error) { // Handle where Logs are redirected: // default 'stdout' (logfile option default value) // else use file (or filepath) set by --logfile option - // that may be overwritten by LogsDir field of config file + // else use LogsDir field of config file logF := c.Options.LogFile logD := c.FileConf.LogsDir if logF != "stdout" { - if logD != "" { + if logF != "" { + if common.IsDir(logF) { + logD = logF + logF = filepath.Join(logF, "xds-agent.log") + } else { + logD = filepath.Dir(logF) + } + } else if logD != "" { lf := filepath.Base(logF) if lf == "" || lf == "." { lf = "xds-agent.log"