Repository navigation
Made Logger public. - #86
Conversation
|
Should we rename |
|
I sort of liked one of the previous iterations where just |
|
The problem is that requires doing an extra dynamic method dispatch on every call to |
|
Hm ok, seems reasonable to me. Thoughts @sfackler? I think this may want some more docs, but I wouldn't mind doing so myself as well. |
|
This seems reasonable to me. One little comment. |
| builder.build() | ||
| } | ||
|
|
||
| pub fn filter(&self) -> LogLevelFilter { |
There was a problem hiding this comment.
Not sure if this should be called filter or something like max_level to match up with the thing passed into init?
There was a problem hiding this comment.
filter seems ok to me as the returned type is LogLevelFilter, but I've always been thrown a bit at least when working out the interaction between LogLevel, LogLevelFilter, and the various functions that consume them.
There was a problem hiding this comment.
Yeah it's a bit awkward. The split's there to avoid having to deal with
what happens if you log at the "off" level.
On Mon, Jun 27, 2016 at 12:30 PM Alex Crichton [email protected]
wrote:
In env/src/lib.rs
#86 (comment):@@ -283,6 +280,21 @@ impl LogBuilder {
}impl Logger {
- pub fn new() -> Logger {
let mut builder = LogBuilder::new();
if let Ok(s) = env::var("RUST_LOG") {builder.parse(&s);}
builder.build()- }
- pub fn filter(&self) -> LogLevelFilter {
filter seems ok to me as the returned type is LogLevelFilter, but I've
always been thrown a bit at least when working out the interaction between
LogLevel, LogLevelFilter, and the various functions that consume them.—
You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub
https://github.com/rust-lang-nursery/log/pull/86/files/415469589ebd0d632758b19aae0d6de051b23ef5#r68609741,
or mute the thread
https://github.com/notifications/unsubscribe/ABY2UbeM0Tj0tviqOvTDsqtQ1eyXWi1iks5qP_qbgaJpZM4I9CHs
.
There was a problem hiding this comment.
I think of it as an instance of the usual "counting fence posts" vs "counting gaps" feature.
|
It might be nice if |
|
This is blocking work on Servo logging / error reporting. Can we merge? |
|
@sfackler how do you feel about merging, want to sort out naming issues beforehand? |
|
No, it seems fine. |
Send log messages to the constellation <!-- Please describe your changes on the following line: --> Send all warnings and errors to the constellation. Warnings are bufferred up, and included in any subsequent error reports. Errors are reported in the same way as panics. Note that this can't merge yet, as it needs rust-lang/log#86 to land. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #11776 (github issue number if applicable). - [X] These changes do not require tests because we don't test crash reporting. <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11841) <!-- Reviewable:end -->
Send log messages to the constellation <!-- Please describe your changes on the following line: --> Send all warnings and errors to the constellation. Warnings are bufferred up, and included in any subsequent error reports. Errors are reported in the same way as panics. Note that this can't merge yet, as it needs rust-lang/log#86 to land. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #11776 (github issue number if applicable). - [X] These changes do not require tests because we don't test crash reporting. <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11841) <!-- Reviewable:end -->
…ajeffrey:constellation-logging); r=Manishearth <!-- Please describe your changes on the following line: --> Send all warnings and errors to the constellation. Warnings are bufferred up, and included in any subsequent error reports. Errors are reported in the same way as panics. Note that this can't merge yet, as it needs rust-lang/log#86 to land. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #11776 (github issue number if applicable). - [X] These changes do not require tests because we don't test crash reporting. <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> Source-Repo: https://github.com/servo/servo Source-Revision: a5cd4b95183da4ae9b754d9d4824bd23f4ad7eb8 UltraBlame original commit: d90b7d6759ec7465e6cf29a5e65c9b4ab954d973
…ajeffrey:constellation-logging); r=Manishearth <!-- Please describe your changes on the following line: --> Send all warnings and errors to the constellation. Warnings are bufferred up, and included in any subsequent error reports. Errors are reported in the same way as panics. Note that this can't merge yet, as it needs rust-lang/log#86 to land. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #11776 (github issue number if applicable). - [X] These changes do not require tests because we don't test crash reporting. <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> Source-Repo: https://github.com/servo/servo Source-Revision: a5cd4b95183da4ae9b754d9d4824bd23f4ad7eb8 UltraBlame original commit: d90b7d6759ec7465e6cf29a5e65c9b4ab954d973
…ajeffrey:constellation-logging); r=Manishearth <!-- Please describe your changes on the following line: --> Send all warnings and errors to the constellation. Warnings are bufferred up, and included in any subsequent error reports. Errors are reported in the same way as panics. Note that this can't merge yet, as it needs rust-lang/log#86 to land. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #11776 (github issue number if applicable). - [X] These changes do not require tests because we don't test crash reporting. <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> Source-Repo: https://github.com/servo/servo Source-Revision: a5cd4b95183da4ae9b754d9d4824bd23f4ad7eb8 UltraBlame original commit: d90b7d6759ec7465e6cf29a5e65c9b4ab954d973
At the moment, the env logger cannot be combined with other loggers, since a)
Loggeris private, and b) logger creation and registration are combined in one function. This PR fixes those.Fixes #85.