Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: improve logs in daemon/server #86

Merged
merged 1 commit into from
Mar 8, 2022
Merged

feat: improve logs in daemon/server #86

merged 1 commit into from
Mar 8, 2022

Conversation

angelofallars
Copy link
Member

@angelofallars angelofallars commented Mar 8, 2022

Some log statements don't appear that clear to the end user.

For example, when swhkd receives a misc. signal:

log::warn!("Got signal: {:#?}", signal);
exit(1);

It only says that it received a signal, but nothing about exiting the program. This can be confusing, so I added a message to say that swhkd is going to exit:

log::warn!("Received signal: {:#?}", signal);
log::warn!("Exiting...");
exit(1);

When swhks receives a message from swhkd, all information about the message is condensed into one line:

log::debug!("Socket: {:?} Address: {:?} Response: {}", socket, address, response);

Splitting the three fields into three lines improves the clarity of the log:

log::debug!("MESSAGE:");
log::debug!("Socket: {:?}", socket);
log::debug!("Address: {:?}", address);
log::debug!("Response: {}", response);

@angelofallars angelofallars added the Enhancement New feature or request label Mar 8, 2022
src/daemon.rs Outdated Show resolved Hide resolved
src/server.rs Outdated Show resolved Hide resolved
@Shinyzenith Shinyzenith merged commit 03c26b8 into main Mar 8, 2022
@Shinyzenith Shinyzenith deleted the improve-logs branch March 13, 2022 05:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request
Development

Successfully merging this pull request may close these issues.

None yet

3 participants