Skip to content

Commit

Permalink
fix(swaybar-ipc): better logs
Browse files Browse the repository at this point in the history
  • Loading branch information
alebastr committed Nov 22, 2021
1 parent 137f854 commit 2c9b7ed
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
1 change: 0 additions & 1 deletion include/modules/sway/bar.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ struct swaybar_config {
std::string id;
std::string mode;
std::string hidden_state;
std::string position;
};

/**
Expand Down
11 changes: 6 additions & 5 deletions src/modules/sway/bar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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();
}
Expand Down

0 comments on commit 2c9b7ed

Please sign in to comment.