1
1
mirror of https://github.com/fatedier/frp.git synced 2025-07-03 05:50:37 +02:00

tweak logs: ()

* show what config frps uses (config file / command line)
* optimize the "start successfully" log message
This commit is contained in:
wxiaoguang
2020-11-23 17:01:31 +08:00
committed by GitHub
parent 3d9499f554
commit fae2f8768d

@ -105,6 +105,7 @@ var rootCmd = &cobra.Command{
var cfg config.ServerCommonConf var cfg config.ServerCommonConf
var err error var err error
if cfgFile != "" { if cfgFile != "" {
log.Info("frps uses config file: %s", cfgFile)
var content string var content string
content, err = config.GetRenderedConfFromFile(cfgFile) content, err = config.GetRenderedConfFromFile(cfgFile)
if err != nil { if err != nil {
@ -112,6 +113,7 @@ var rootCmd = &cobra.Command{
} }
cfg, err = parseServerCommonCfg(CfgFileTypeIni, content) cfg, err = parseServerCommonCfg(CfgFileTypeIni, content)
} else { } else {
log.Info("frps uses command line arguments for config")
cfg, err = parseServerCommonCfg(CfgFileTypeCmd, "") cfg, err = parseServerCommonCfg(CfgFileTypeCmd, "")
} }
if err != nil { if err != nil {
@ -212,7 +214,7 @@ func runServer(cfg config.ServerCommonConf) (err error) {
if err != nil { if err != nil {
return err return err
} }
log.Info("start frps success") log.Info("frps started successfully")
svr.Run() svr.Run()
return return
} }