-
Notifications
You must be signed in to change notification settings - Fork 124
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(client,server): rework logging #1692
Conversation
Would Exploring another alternative: I removed the A request to google.com now looks like the below. Always printing request content is somewhat similar to curl's default behavior.
@larseggert let me know what you think. |
Friendly ping @larseggert. I don't feel strongly about any of the proposals in this pull request. I want to start on #1696, laying the groundwork for #1693. For the sake of keeping merge conflicts small, shall we merge or close here? |
I don't feel strongly either. I have a mile preference that if we're going to use the logging framework for things, we should use it as much as possible, i.e., avoid esp. |
Probably close? |
I've changed my mind on this, we should use the neqo log functions, and also use (Also, because right now |
Neat! I will revive the pull request. |
- In `neqo-client` and `neqo-server` use `neqo_common::log` instead of `println!` and `eprintln!`. - Add `-q`, `-v`, `-vv`, `-vvv`, `-vvvv` log level flags via `clap_verbosity_flag`. - Set default log level to INFO. Demote many `qinfo!` to `qdebug!`.
I updated the pull request with the above suggestion, i.e. to use In addition I demoted multiple Sample output:
@larseggert @KershawChang would you mind taking another look? I am not familiar with how Neqo logging is used within Firefox, thus please review carefully. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but want to hear from the other owners.
Needed in order for mozlog_neqo_cwnd.py to analyze cc.
mozilla#1692 introduced verbosity command line flags in `neqo-server` and `neqo-client`. This commit makes use of the flags instead of the `RUST_LOG` environment variable.
There are two ways to specify the maximum log level of `neqo-server` and `neqo-client`. Via the `RUST_LOG` environment variable and since mozilla#1692 via the verbosity flags (e.g. `-v`). Previously, if no verbosity flag was provided, `INFO` was set as the maximum log level, the `RUST_LOG` environment variable was simply ignored. With this commit, if no flag is set, the `RUST_LOG` environment variable is considered, and only then the `env_logger` crate default value (`ERROR`) is used. In other words, the precedence order now is: 1. command line flags (e.g. `-v`) 2. `RUST_LOG` environment variable 3. default `ERROR` level
There are two ways to specify the maximum log level of `neqo-server` and `neqo-client`. Via the `RUST_LOG` environment variable and since mozilla#1692 via the verbosity flags (e.g. `-v`). Previously, if no verbosity flag was provided, `INFO` was set as the maximum log level, the `RUST_LOG` environment variable was simply ignored. With this commit, if no flag is set, the `RUST_LOG` environment variable is considered, and only then the `env_logger` crate default value (`ERROR`) is used. In other words, the precedence order now is: 1. command line flags (e.g. `-v`) 2. `RUST_LOG` environment variable 3. default `ERROR` level
* fix(bin): consider env when no verbosity flag is set There are two ways to specify the maximum log level of `neqo-server` and `neqo-client`. Via the `RUST_LOG` environment variable and since #1692 via the verbosity flags (e.g. `-v`). Previously, if no verbosity flag was provided, `INFO` was set as the maximum log level, the `RUST_LOG` environment variable was simply ignored. With this commit, if no flag is set, the `RUST_LOG` environment variable is considered, and only then the `env_logger` crate default value (`ERROR`) is used. In other words, the precedence order now is: 1. command line flags (e.g. `-v`) 2. `RUST_LOG` environment variable 3. default `ERROR` level * clippy * Move `verbose` into `SharedArgs`
There are two server implementations based on neqo: 1. https://github.com/mozilla/neqo/tree/main/neqo-bin/src/server - http3 and http09 implementation - used for manual testing and QUIC Interop 2. https://searchfox.org/mozilla-central/source/netwerk/test/http3server/src/main.rs - used to test Firefox I assume one was once an exact copy of the other. Both implement their own I/O, event loop, ... Since then, the two implementations diverged significantly. Especially (1) saw a lot of improvements in recent months: - mozilla#1564 - mozilla#1569 - mozilla#1578 - mozilla#1581 - mozilla#1604 - mozilla#1612 - mozilla#1676 - mozilla#1692 - mozilla#1707 - mozilla#1708 - mozilla#1727 - mozilla#1753 - mozilla#1756 - mozilla#1766 - mozilla#1772 - mozilla#1786 - mozilla#1787 - mozilla#1788 - mozilla#1794 - mozilla#1806 - mozilla#1808 - mozilla#1848 - mozilla#1866 At this point, bugs in (2) are hard to fix, see e.g. mozilla#1801. This commit merges (2) into (1), thus removing all duplicate logic and having (2) benefit from all the recent improvements to (1).
There are two server implementations based on neqo: 1. https://github.com/mozilla/neqo/tree/main/neqo-bin/src/server - http3 and http09 implementation - used for manual testing and QUIC Interop 2. https://searchfox.org/mozilla-central/source/netwerk/test/http3server/src/main.rs - used to test Firefox I assume one was once an exact copy of the other. Both implement their own I/O, event loop, ... Since then, the two implementations diverged significantly. Especially (1) saw a lot of improvements in recent months: - mozilla#1564 - mozilla#1569 - mozilla#1578 - mozilla#1581 - mozilla#1604 - mozilla#1612 - mozilla#1676 - mozilla#1692 - mozilla#1707 - mozilla#1708 - mozilla#1727 - mozilla#1753 - mozilla#1756 - mozilla#1766 - mozilla#1772 - mozilla#1786 - mozilla#1787 - mozilla#1788 - mozilla#1794 - mozilla#1806 - mozilla#1808 - mozilla#1848 - mozilla#1866 At this point, bugs in (2) are hard to fix, see e.g. mozilla#1801. This commit merges (2) into (1), thus removing all duplicate logic and having (2) benefit from all the recent improvements to (1).
* refactor(bin): introduce server/http3.rs and server/http09.rs The QUIC Interop Runner requires an http3 and http09 implementation for both client and server. The client code is already structured into an http3 and an http09 implementation since #1727. This commit does the same for the server side, i.e. splits the http3 and http09 implementation into separate Rust modules. * refactor: merge mozilla-central http3 server into neqo-bin There are two server implementations based on neqo: 1. https://github.com/mozilla/neqo/tree/main/neqo-bin/src/server - http3 and http09 implementation - used for manual testing and QUIC Interop 2. https://searchfox.org/mozilla-central/source/netwerk/test/http3server/src/main.rs - used to test Firefox I assume one was once an exact copy of the other. Both implement their own I/O, event loop, ... Since then, the two implementations diverged significantly. Especially (1) saw a lot of improvements in recent months: - #1564 - #1569 - #1578 - #1581 - #1604 - #1612 - #1676 - #1692 - #1707 - #1708 - #1727 - #1753 - #1756 - #1766 - #1772 - #1786 - #1787 - #1788 - #1794 - #1806 - #1808 - #1848 - #1866 At this point, bugs in (2) are hard to fix, see e.g. #1801. This commit merges (2) into (1), thus removing all duplicate logic and having (2) benefit from all the recent improvements to (1). * Move firefox.rs to mozilla-central * Reduce HttpServer trait functions * Extract constructor * Remove unused deps * Remove clap color feature Nice to have. Adds multiple dependencies. Hard to justify for mozilla-central.
neqo-client
andneqo-server
useneqo_common::log
instead ofprintln!
andeprintln!
.-q
,-v
,-vv
,-vvv
,-vvvv
log level flags viaclap_verbosity_flag
.qinfo!
toqdebug!
.Fixes #685.