fix(swaybar-ipc): better logs

This commit is contained in:
Aleksei Bavshin 2021-11-21 17:28:47 -08:00
parent 5baffbf8f8
commit 6bfb674d1b
No known key found for this signature in database
GPG Key ID: 4F071603387A382A
2 changed files with 6 additions and 6 deletions

View File

@ -18,7 +18,6 @@ struct swaybar_config {
std::string id;
std::string mode;
std::string hidden_state;
std::string position;
};
/**

View File

@ -43,9 +43,6 @@ struct swaybar_config parseConfig(const Json::Value& payload) {
if (auto hs = payload["hidden_state"]; hs.isString()) {
conf.hidden_state = hs.asString();
}
if (auto position = payload["position"]; position.isString()) {
conf.position = position.asString();
}
return conf;
}
@ -80,13 +77,17 @@ void BarIpcClient::onIpcEvent(const struct Ipc::ipc_response& res) {
}
void BarIpcClient::onConfigUpdate(const swaybar_config& config) {
spdlog::info("config update: {} {} {}", config.id, config.mode, config.position);
spdlog::info("config update for {}: id {}, mode {}, hidden_state {}",
bar_.bar_id,
config.id,
config.mode,
config.hidden_state);
bar_config_ = config;
update();
}
void BarIpcClient::onVisibilityUpdate(bool visible_by_modifier) {
spdlog::trace("visiblity update: {}", visible_by_modifier);
spdlog::debug("visiblity update for {}: {}", bar_.bar_id, visible_by_modifier);
visible_by_modifier_ = visible_by_modifier;
update();
}