mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-02-18 20:30:51 +08:00
feat(config): disable logging and usage stats by default
This commit is contained in:
@@ -180,8 +180,8 @@ func LoadConfigOptional(configFile string, optional bool) (*Config, error) {
|
|||||||
// Unmarshal the YAML data into the Config struct.
|
// Unmarshal the YAML data into the Config struct.
|
||||||
var cfg Config
|
var cfg Config
|
||||||
// Set defaults before unmarshal so that absent keys keep defaults.
|
// Set defaults before unmarshal so that absent keys keep defaults.
|
||||||
cfg.LoggingToFile = true
|
cfg.LoggingToFile = false
|
||||||
cfg.UsageStatisticsEnabled = true
|
cfg.UsageStatisticsEnabled = false
|
||||||
if err = yaml.Unmarshal(data, &cfg); err != nil {
|
if err = yaml.Unmarshal(data, &cfg); err != nil {
|
||||||
if optional {
|
if optional {
|
||||||
// In cloud deploy mode, if YAML parsing fails, return empty config instead of error.
|
// In cloud deploy mode, if YAML parsing fails, return empty config instead of error.
|
||||||
|
|||||||
Reference in New Issue
Block a user