mirror of
https://github.com/bcicen/ctop.git
synced 2024-08-30 18:23:19 +00:00
add log message to config toggle
This commit is contained in:
parent
d56af1d932
commit
0b100bf4fa
@ -36,6 +36,7 @@ func GetToggle(k string) bool {
|
||||
// Toggle a boolean option
|
||||
func Toggle(k string) {
|
||||
Global.toggles[k] = Global.toggles[k] != true
|
||||
log.Noticef("config change: %s = %t", k, Global.toggles[k])
|
||||
}
|
||||
|
||||
type ConfigMsg struct {
|
||||
@ -44,7 +45,6 @@ type ConfigMsg struct {
|
||||
}
|
||||
|
||||
func Update(k, v string) {
|
||||
log.Noticef("config update: %s = %s", k, v)
|
||||
Global.updates <- ConfigMsg{k, v}
|
||||
}
|
||||
|
||||
@ -70,6 +70,7 @@ func NewDefaultConfig() Config {
|
||||
go func() {
|
||||
for m := range config.updates {
|
||||
config.params[m.key] = m.val
|
||||
log.Noticef("config change: %s = %s", m.key, m.val)
|
||||
}
|
||||
}()
|
||||
return config
|
||||
|
Loading…
Reference in New Issue
Block a user