File tree Expand file tree Collapse file tree 2 files changed +3
-1
lines changed
Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ func Log() {
2222 FullTimestamp : true ,
2323 })
2424 logConfig := conf .Conf .Log
25- if ! args . Debug && logConfig .Path != "" {
25+ if logConfig .Enable {
2626 var (
2727 writer * rotatelogs.RotateLogs
2828 err error
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ type CacheConfig struct {
2424}
2525
2626type LogConfig struct {
27+ Enable bool `json:"enable" env:"log_enable"`
2728 Path string `json:"path" env:"LOG_PATH"`
2829 Name string `json:"name" env:"LOG_NAME"`
2930 RotationTime uint `json:"rotation_time" env:"LOG_TIME"`
@@ -59,6 +60,7 @@ func DefaultConfig() *Config {
5960 CleanupInterval : 120 ,
6061 },
6162 Log : LogConfig {
63+ Enable : true ,
6264 Path : "log/%Y-%m-%d-%H:%M.log" ,
6365 Name : "log/log.log" ,
6466 RotationTime : 24 ,
You can’t perform that action at this time.
0 commit comments