mirror of
https://github.com/AdguardTeam/AdGuardHome.git
synced 2025-05-04 15:02:58 +03:00
Pull request 2242: 7079-log-enabled
Updates #7079.
Squashed commit of the following:
commit 477c5ed29c8066dc9cb175809572f613b2a0dfa0
Merge: d3c64e03a 647214092
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date: Thu Jun 20 19:31:54 2024 +0300
Merge branch 'master' into 7079-log-enabled
commit d3c64e03a514e39d70e6b79209be1f8cf052a25d
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date: Thu Jun 20 16:02:42 2024 +0300
home: imp docs
commit 7658c9b107f109c391b6bd5407098e8e53754842
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date: Thu Jun 20 14:17:08 2024 +0300
all: log enabled
This commit is contained in:
parent
6472140920
commit
65b7d232ab
3 changed files with 25 additions and 4 deletions
internal/home
|
@ -21,7 +21,9 @@ func configureLogger(opts options) (err error) {
|
|||
ls := getLogSettings(opts)
|
||||
|
||||
// Configure logger level.
|
||||
if ls.Verbose {
|
||||
if !ls.Enabled {
|
||||
log.SetLevel(log.OFF)
|
||||
} else if ls.Verbose {
|
||||
log.SetLevel(log.DEBUG)
|
||||
}
|
||||
|
||||
|
@ -91,7 +93,14 @@ func getLogSettings(opts options) (ls *logSettings) {
|
|||
// separate method in order to configure logger before the actual configuration
|
||||
// is parsed and applied.
|
||||
func readLogSettings() (ls *logSettings) {
|
||||
conf := &configuration{}
|
||||
// TODO(s.chzhen): Add a helper function that returns default parameters
|
||||
// for this structure and for the global configuration structure [config].
|
||||
conf := &configuration{
|
||||
Log: logSettings{
|
||||
// By default, it is true if the property does not exist.
|
||||
Enabled: true,
|
||||
},
|
||||
}
|
||||
|
||||
yamlFile, err := readConfigFile()
|
||||
if err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue