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

add silent and verbose log option #8

Merged
merged 3 commits into from Jan 31, 2024
Merged

Conversation

JyJyJcr
Copy link
Collaborator

@JyJyJcr JyJyJcr commented Jan 30, 2024

with option -s or --silent, log nothing.
with option -v or --verbose, log debug message.
now -s option enables to remove the two line errors at exit as below:

log4rs: Broken pipe (os error 32)
log4rs: Broken pipe (os error 32)

these errors were caused by sending log messages to the pipe between ssh client (as stdout) when it is already closed.

@oowl
Copy link
Owner

oowl commented Jan 31, 2024

Actually, I would prefer to use env_logger to achieve it. https://docs.rs/env_logger/latest/env_logger/

@JyJyJcr
Copy link
Collaborator Author

JyJyJcr commented Jan 31, 2024

env_logger seems great for log level control, but it cannot output into file but stdout or stderr. If you not care for the log_file option --log, I'll replace log4rs to env_logger.

@oowl
Copy link
Owner

oowl commented Jan 31, 2024

env_logger seems great for log level control, but it cannot output into file but stdout or stderr. If you not care for the log_file option --log, I'll replace log4rs to env_logger.

Yeah, it can accept not using log4rs.

@JyJyJcr
Copy link
Collaborator Author

JyJyJcr commented Jan 31, 2024

switched to env_logger. timestamp format slightly changed.

log4rs:

2024-01-31T23:45:26.791057+09:00 INFO quicssh_rs::client - [client] Connecting to <addr>

env_logger:

[2024-01-31T14:46:01Z INFO  quicssh_rs::client] [client] Connecting to <addr>

@oowl
Copy link
Owner

oowl commented Jan 31, 2024

Thanks!

@oowl oowl merged commit b7579cc into oowl:master Jan 31, 2024
7 checks passed
@oowl
Copy link
Owner

oowl commented Jan 31, 2024

@JyJyJcr we also need to update README doc https://github.com/oowl/quicssh-rs?tab=readme-ov-file#usage, Can you help me update it?

@JyJyJcr
Copy link
Collaborator Author

JyJyJcr commented Jan 31, 2024

OK, I continue to use this branch to update README/Usage.
pull-requesting from this branch inevitably contains duplicated commits, so I requested from another branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants