Skip to content

Conversation

angelofallars
Copy link
Contributor

@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
@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.

3 participants