repo stringclasses 1
value | pull_number int64 70 619 | instance_id stringlengths 17 18 | issue_numbers listlengths 1 1 | base_commit stringlengths 40 40 | patch stringlengths 341 89.2k | test_patch stringlengths 548 5.67k | problem_statement stringlengths 67 4.82k | hints_text stringlengths 0 4.86k | created_at stringlengths 20 20 | version stringclasses 2
values | environment_setup_commit stringclasses 2
values |
|---|---|---|---|---|---|---|---|---|---|---|---|
rust-lang/log | 619 | rust-lang__log-619 | [
"601"
] | 06c306fa8f4d41a722f8759f03effd4185eee3ee | diff --git a/Cargo.toml b/Cargo.toml
index c0ea52a77..72fcdb0e4 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -20,8 +20,8 @@ edition = "2021"
features = ["std", "serde", "kv_std", "kv_sval", "kv_serde"]
[[test]]
-name = "filters"
-path = "tests/filters.rs"
+name = "integration"
+path = "tests/integration.rs"
harness... | diff --git a/tests/filters.rs b/tests/integration.rs
similarity index 56%
rename from tests/filters.rs
rename to tests/integration.rs
index 3e0810d07..7bf456e02 100644
--- a/tests/filters.rs
+++ b/tests/integration.rs
@@ -12,7 +12,8 @@ fn set_boxed_logger(logger: Box<dyn Log>) -> Result<(), log::SetLoggerError> {
}
... | Add tests that check the line numbers
We currently don't have any.
| Im pretty new to contributing, but I would love to contribute to this repo. Would this be a good issue to start with?
> Im pretty new to contributing, but I would love to contribute to this repo. Would this be a good issue to start with?
Hey @DIvkov575 sorry for the delayed response, I've been traveling.
I think ... | 2024-03-16T14:49:52Z | 0.4 | 06c306fa8f4d41a722f8759f03effd4185eee3ee |
rust-lang/log | 613 | rust-lang__log-613 | [
"584"
] | 7cb6a01dff9157f3f3dca36aa0152f144023ff60 | diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 3fc335e73..3c263a434 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -44,10 +44,10 @@ jobs:
- run: cargo test --verbose --all-features
- run: cargo test --verbose --features serde
- run: cargo test --ve... | diff --git a/tests/Cargo.toml b/tests/Cargo.toml
index 88f37b5d4..8754bb16a 100644
--- a/tests/Cargo.toml
+++ b/tests/Cargo.toml
@@ -7,6 +7,10 @@ build = "src/build.rs"
[features]
std = ["log/std"]
+kv = ["log/kv"]
+kv_std = ["log/kv_std"]
+kv_sval = ["log/kv_sval"]
+kv_serde = ["log/kv_serde"]
[dependencies.log... | Review of key-value feature
Discussion for https://github.com/rust-lang/log/issues/328.
| Thanks for all the time you've spent digging through this so far @Thomasdezeeuw! I think we're getting towards something that feels appropriate for the `log` crate without losing capability.
Just checking back in on this, is the main blocker we've got deciding whether to default to capturing using `ToValue` and suppor... | 2024-01-26T08:08:39Z | 0.4 | 06c306fa8f4d41a722f8759f03effd4185eee3ee |
rust-lang/log | 495 | rust-lang__log-495 | [
"494"
] | bc181df9fbb1ad40abcae41ae2dd53b3652b50bc | diff --git a/src/macros.rs b/src/macros.rs
index ec2f4200c..a4fe6803b 100644
--- a/src/macros.rs
+++ b/src/macros.rs
@@ -37,7 +37,7 @@ macro_rules! log {
__log_format_args!($($arg)+),
lvl,
&($target, __log_module_path!(), __log_file!(), __log_line!()),
- ... | diff --git a/tests/macros.rs b/tests/macros.rs
index 7b2483ceb..fcd8556a3 100644
--- a/tests/macros.rs
+++ b/tests/macros.rs
@@ -215,3 +215,16 @@ fn kv_string_keys() {
all_log_macros!(target: "my_target", "also dogs" = "Fílos", "key/that-can't/be/an/ident" = "hi"; "hello {world}", world = "world");
}
+
+/// Som... | regression: enum variant named None fails to compile in 0.4.15
I have written some poker software where it makes sense (at least to me!) to have a `None` variant. When I upgraded to log 0.4.15, my code stopped compiling. Here's a short illustration:
```
#[derive(Debug)]
pub enum Limit {
None,
}
pub struct M... | It looks like this `None` (and the `Some` above it) needs to be fully qualified: https://github.com/rust-lang/log/blob/master/src/macros.rs#L53
@sfackler can you make a pr or want me to do it?
I can make one later today, but go for it if you have the time earlier. | 2022-03-22T13:01:36Z | 0.4 | 06c306fa8f4d41a722f8759f03effd4185eee3ee |
rust-lang/log | 470 | rust-lang__log-470 | [
"381"
] | 525336f364fb80b63d910e783884b14be71814c5 | diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index d90d48baa..855a2d965 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -37,6 +37,8 @@ jobs:
rustup update ${{ matrix.rust }} --no-self-update
rustup default ${{ matrix.rust }}
- run: cargo test --... | diff --git a/tests/filters.rs b/tests/filters.rs
index de6bd189f..f37751c24 100644
--- a/tests/filters.rs
+++ b/tests/filters.rs
@@ -1,3 +1,5 @@
+#![allow(dead_code, unused_imports)]
+
#[cfg(not(lib_build))]
#[macro_use]
extern crate log;
@@ -32,18 +34,36 @@ impl Log for Logger {
#[cfg_attr(lib_build, test)]
fn ... | `cargo test --all-features` fails
from git master, if i run `cargo test --all-features`, i see:
```
Finished dev [unoptimized + debuginfo] target(s) in 0.01s
Running target/debug/deps/log-7d6eb7ffa43b7118
running 45 tests
test kv::key::tests::key_from_string ... ok
test kv::source::std_support::tests... | Ah, unfortunately `log`'s features are set up in such a way that running with `--all-features` doesn't really make sense (it uses features to set minimum levels at compile-time). It's unfortunate for tests to fail though since `--all-features` should be a perfectly legitimate flag so we should do something about the fi... | 2021-11-15T06:58:10Z | 0.4 | 06c306fa8f4d41a722f8759f03effd4185eee3ee |
rust-lang/log | 423 | rust-lang__log-423 | [
"408"
] | cb0b8c4f93758531ef3eada40da2642e9ed0d616 | diff --git a/Cargo.toml b/Cargo.toml
index 69fe79d25..299937c3e 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -16,7 +16,7 @@ exclude = ["rfcs/**/*", "/.travis.yml", "/appveyor.yml"]
build = "build.rs"
[package.metadata.docs.rs]
-features = ["std", "serde", "kv_unstable_sval"]
+features = ["std", "serde", "kv_unstable... | diff --git a/src/kv/value/test.rs b/src/kv/value/test.rs
deleted file mode 100644
index ab5f8075e..000000000
--- a/src/kv/value/test.rs
+++ /dev/null
@@ -1,81 +0,0 @@
-// Test support for inspecting Values
-
-use std::fmt;
-use std::str;
-
-use super::internal;
-use super::{Error, Value};
-
-#[derive(Debug, PartialEq)]... | Support converting Errors into Values
There are some design decisions to make around `dyn Error` vs `dyn Error + 'static`, but I've been looking at providing a proper downcasting API too.
| 2020-11-11T03:25:19Z | 0.4 | 06c306fa8f4d41a722f8759f03effd4185eee3ee | |
rust-lang/log | 370 | rust-lang__log-370 | [
"369"
] | 87fc152d40f06623e109ead03cba0431da0e7f73 | diff --git a/src/macros.rs b/src/macros.rs
index 23378fc5e..f628664b7 100644
--- a/src/macros.rs
+++ b/src/macros.rs
@@ -47,7 +47,7 @@ macro_rules! log {
#[doc(hidden)]
macro_rules! log_impl {
// End of macro input
- (target: $target:expr, $lvl:expr, ($message:expr)) => {
+ (target: $target:expr, $lvl:expr... | diff --git a/tests/macros.rs b/tests/macros.rs
index f41c52ed3..34c89811f 100644
--- a/tests/macros.rs
+++ b/tests/macros.rs
@@ -7,6 +7,11 @@ fn base() {
info!("hello",);
}
+#[test]
+fn base_expr_context() {
+ let _ = info!("hello");
+}
+
#[test]
fn with_args() {
info!("hello {}", "cats");
@@ -14,6 +1... | 0.4.9 release seems to break tokio (which depends on log)
You can see an example of this here: https://github.com/alex/otp-cop/pull/374/checks?check_run_id=349720268
I didn't see a mention of breaking changes (besides MSRV) in the CHANGELOG, so I'm filing this here. Let me know if this should be filed on tokio inste... | I am receiving similar errors trying to install cargo-make.
```
Compiling cargo-make v0.24.1
error: macro expansion ignores token `if` and any following
--> <::log::macros::log_impl macros>:13:23
|
13 | let lvl = $ lvl ; if lvl <= $ crate :: STATIC_MAX_LEVEL && lvl <= $ crate
| ... | 2019-12-16T00:11:28Z | 0.4 | 06c306fa8f4d41a722f8759f03effd4185eee3ee |
rust-lang/log | 245 | rust-lang__log-245 | [
"243"
] | 1e12cfa3b3ba2a1f1ed80588fd9ebfc3ba46065d | diff --git a/src/lib.rs b/src/lib.rs
index feea3d326..50423604a 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -164,10 +164,7 @@
//! static LOGGER: SimpleLogger = SimpleLogger;
//!
//! pub fn init() -> Result<(), SetLoggerError> {
-//! log::set_logger(|max_level| {
-//! max_level.set(LevelFilter::Info);
-//!... | diff --git a/tests/filters.rs b/tests/filters.rs
index d28fa004e..84449ccfe 100644
--- a/tests/filters.rs
+++ b/tests/filters.rs
@@ -3,20 +3,17 @@ extern crate log;
use std::sync::{Arc, Mutex};
use log::{Level, LevelFilter, Log, Record, Metadata};
-use log::MaxLevelFilter;
-#[cfg(feature = "use_std")]
+#[cfg(feat... | Possibly removing closures from `set_*_logger` functions?
Are the closures still needed any more? (I'm probably missing some historical context).
I could imagine that we don't have closures here but rather just parameters along with a free function that sets the max level (at any time). Although maybe there's a down... | The closure-based indirection is there to make sure the active logger is the only thing that can mess with the max log level, yeah. The main downside is that random code could come in and poke the max log level in confusing ways, but maybe that's not enough of an issue that we need to worry about the extra weirdness?
H... | 2017-12-06T04:54:16Z | 0.3 | 1e12cfa3b3ba2a1f1ed80588fd9ebfc3ba46065d |
rust-lang/log | 224 | rust-lang__log-224 | [
"145"
] | 8af5f3c688461a166a5097c395a5deb6c99a70ed | diff --git a/.travis.yml b/.travis.yml
index 226c591c8..6bc0aa9ed 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -13,11 +13,8 @@ script:
- cargo test --verbose
- cargo test --verbose --features serde
- cargo test --verbose --no-default-features
- - cargo test --verbose --manifest-path env/Cargo.toml
- - cargo... | diff --git a/env/tests/regexp_filter.rs b/env/tests/regexp_filter.rs
deleted file mode 100644
index d23e9223e..000000000
--- a/env/tests/regexp_filter.rs
+++ /dev/null
@@ -1,51 +0,0 @@
-#[macro_use] extern crate log;
-extern crate env_logger;
-
-use std::process;
-use std::env;
-use std::str;
-
-fn main() {
- if env... | Remove env_logger from this repository
Let's find a suitable maintainer and move it out of the `log` repository itself. While still a high quality logger that we'd likely want to recommend, it may benefit from spreading out the maintenance burden! Tons of possible features were mentioned for `env_logger` on the [evalua... | Hey @alexcrichton, I've started to work on this split at [sebasmagri/env_logger](https://github.com/sebasmagri/env_logger).
I'll review the features mentioned in the evaluation thread and check out the API guidelines for the new repo.
For now, I'm pointing it to `log`'s git repo since there where some breaking ch... | 2017-09-17T05:41:09Z | 0.3 | 1e12cfa3b3ba2a1f1ed80588fd9ebfc3ba46065d |
rust-lang/log | 217 | rust-lang__log-217 | [
"148"
] | 25e349c7389ab63a9f5303a9a6183aa9d723b0a0 | diff --git a/.travis.yml b/.travis.yml
index 1b82ecd3a..479981582 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -12,6 +12,7 @@ script:
- ([ $TRAVIS_RUST_VERSION != nightly ] || cargo build --verbose --features nightly)
- cargo test --verbose
- ([ $TRAVIS_RUST_VERSION != nightly ] || cargo test --verbose --no-d... | diff --git a/log-test/Cargo.toml b/log-test/Cargo.toml
new file mode 100644
index 000000000..82eaf1add
--- /dev/null
+++ b/log-test/Cargo.toml
@@ -0,0 +1,11 @@
+[package]
+name = "log-test"
+version = "0.1.0"
+authors = ["Steven Fackler <sfackler@gmail.com>"]
+
+[dependencies]
+log = { path = ".." }
+
+[[test]]
+name =... | Ensure 0.3 works with the next major release
We'll want to publish a version of 0.3 that works as a compatibility layer to the 0.4 version of the `log` crate
| If it's alright and no one else has started, I can start working on a shared backend crate for this.
I'm trying to think of the best way to have it be efficient, while still allowing for maximum change. Right now my best idea is to have a versioned API that would be somewhat like the following:
```rust
pub fn re... | 2017-08-13T23:43:25Z | 0.3 | 1e12cfa3b3ba2a1f1ed80588fd9ebfc3ba46065d |
rust-lang/log | 208 | rust-lang__log-208 | [
"204"
] | 8af5f3c688461a166a5097c395a5deb6c99a70ed | diff --git a/src/lib.rs b/src/lib.rs
index 50479f619..e31451324 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -190,8 +190,9 @@
//! To use the `log` crate without depending on `libstd`, you need to specify
//! `default-features = false` when specifying the dependency in `Cargo.toml`.
//! This makes no difference to lib... | diff --git a/tests/filters.rs b/tests/filters.rs
index 5fc55b2d4..4b4d09050 100644
--- a/tests/filters.rs
+++ b/tests/filters.rs
@@ -11,7 +11,7 @@ use log::try_set_logger;
fn try_set_logger<M>(make_logger: M) -> Result<(), log::SetLoggerError>
where M: FnOnce(MaxLevelFilter) -> Box<Log>
{
- unsafe { log::set_... | Rename set_logger_raw to try_set_logger_raw
With respect to the changes made in #187, it makes sense to change set_logger_raw to panic on error (just like set_logger); where set_logger_raw panics on error and try_set_logger_raw returns error.
@alexcrichton @dtolnay
| The rationale to change `set_logger` to panic-on-error was that most libraries would transitively call it through their logger's initialization function. I'd imagine, however, that `set_logger_raw` is quite rarely called, so I'd actually advoate for renaming `set_logger_raw` to `try_set_logger_raw` and *not* adding a p... | 2017-07-16T17:18:17Z | 0.3 | 1e12cfa3b3ba2a1f1ed80588fd9ebfc3ba46065d |
rust-lang/log | 196 | rust-lang__log-196 | [
"117"
] | c77cd5e37f3036f59a29f4f0d2bc36efe6ec10ff | diff --git a/env/src/lib.rs b/env/src/lib.rs
index cc3983352..4c6ca69c3 100644
--- a/env/src/lib.rs
+++ b/env/src/lib.rs
@@ -375,6 +375,8 @@ impl Log for Logger {
},
};
}
+
+ fn flush(&self) {}
}
struct Directive {
diff --git a/src/lib.rs b/src/lib.rs
index f485c1b54..9f3bfccbc 100644
... | diff --git a/tests/filters.rs b/tests/filters.rs
index f40af728e..5fc55b2d4 100644
--- a/tests/filters.rs
+++ b/tests/filters.rs
@@ -29,6 +29,7 @@ impl Log for Logger {
fn log(&self, record: &Record) {
*self.0.last_log.lock().unwrap() = Some(record.level());
}
+ fn flush(&self) {}
}
fn main() ... | Remove logger shutdown
This adds some complexity to the logger plus extra cost on all logger calls. In our discussion of this issue the review team also concluded that it would be prudent to maybe add a top-level flushing method to explicitly ensure that a common part of shutdown, flushing, can still be manually perfor... | Hi all,
I'm interested in diving into this one, but I could use a little guidance. Is this about exposing a `flush`, or removing `shutdown`? Or, rather, is it about removing the state (and therefore the check) from the logger's state machine?
Thanks!
All of the above! Removing shutdown allows https://github.com... | 2017-06-05T19:55:04Z | 0.3 | 1e12cfa3b3ba2a1f1ed80588fd9ebfc3ba46065d |
rust-lang/log | 184 | rust-lang__log-184 | [
"182"
] | 5fac11ad3ba99dacd652c2bab92f6416e93a6115 | diff --git a/src/lib.rs b/src/lib.rs
index 8ca360c1c..c6eaa2651 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -269,8 +269,7 @@ const INITIALIZED: usize = 2;
static MAX_LOG_LEVEL_FILTER: AtomicUsize = ATOMIC_USIZE_INIT;
-static LOG_LEVEL_NAMES: [&'static str; 6] = ["OFF", "ERROR", "WARN", "INFO",
- ... | diff --git a/tests/filters.rs b/tests/filters.rs
index 0497c11c6..fc8cac863 100644
--- a/tests/filters.rs
+++ b/tests/filters.rs
@@ -1,4 +1,5 @@
-#[macro_use] extern crate log;
+#[macro_use]
+extern crate log;
use std::sync::{Arc, Mutex};
use log::{Level, LevelFilter, Log, Record, Metadata};
@@ -8,10 +9,9 @@ use lo... | Consider rustfmt
Moved from https://github.com/rust-lang-nursery/log/issues/150#issuecomment-304629732:
> Could we make `rust fmt` mandatory for this crate ?
| I agree with using rustfmt.
I generally disagree with requiring rustfmt for a build to pass. The tradeoff is scaring away new contributors. If someone makes a PR, I would prefer that they remember it as a reasonable discussion about meaningful things, rather than as a struggle to satisfy a grumpy buildbot. If the co... | 2017-05-30T04:05:16Z | 0.3 | 1e12cfa3b3ba2a1f1ed80588fd9ebfc3ba46065d |
rust-lang/log | 162 | rust-lang__log-162 | [
"142"
] | cf501f637578394612ea88f103e3b117cbf9f71e | diff --git a/env/src/lib.rs b/env/src/lib.rs
index 7e2f9da7e..b30d0ff69 100644
--- a/env/src/lib.rs
+++ b/env/src/lib.rs
@@ -17,7 +17,7 @@
//! #[macro_use] extern crate log;
//! extern crate env_logger;
//!
-//! use log::LogLevel;
+//! use log::Level;
//!
//! fn main() {
//! env_logger::init().unwrap();
@@ -2... | diff --git a/tests/filters.rs b/tests/filters.rs
index e08d46db1..0497c11c6 100644
--- a/tests/filters.rs
+++ b/tests/filters.rs
@@ -1,32 +1,32 @@
#[macro_use] extern crate log;
use std::sync::{Arc, Mutex};
-use log::{LogLevel, LogLevelFilter, Log, LogRecord, LogMetadata};
-use log::MaxLogLevelFilter;
+use log::{Le... | Reduce "stuttering" in types
Rename types like `log::LogRecord` to `log::Record`
| I'd like to try working on this.
To confirm:
`LogLevel` -> `Level`
`LogLevelFilter` -> `LevelFilter`
`LogRecord` -> `Record`
`LogMetadata` -> `Metadata`, etc.?
Just types? What about functions like `log::LogLevel::to_log_level_filter()`? Should it become `log::Level::to_level_filter`?
Should `MaxLogLeve... | 2017-05-22T00:58:25Z | 0.3 | 1e12cfa3b3ba2a1f1ed80588fd9ebfc3ba46065d |
rust-lang/log | 70 | rust-lang__log-70 | [
"13"
] | 7067c9b8c1f1a46ab66fd23b7df0e7aa00fe3a87 | diff --git a/.travis.yml b/.travis.yml
index 15b6a4778..5dfb476ed 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -7,8 +7,10 @@ rust:
- nightly
script:
- cargo build --verbose
+ - ([ $TRAVIS_RUST_VERSION != nightly ] || cargo build --verbose --no-default-features)
- ([ $TRAVIS_RUST_VERSION != nightly ] || carg... | diff --git a/tests/filters.rs b/tests/filters.rs
index 6f352eca9..e08d46db1 100644
--- a/tests/filters.rs
+++ b/tests/filters.rs
@@ -1,9 +1,19 @@
#[macro_use] extern crate log;
use std::sync::{Arc, Mutex};
-use log::{LogLevel, set_logger, LogLevelFilter, Log, LogRecord, LogMetadata};
+use log::{LogLevel, LogLevelFi... | Use core not std
I believe everything in the logging interface just requires core, not std. (The `Box<Log>` could become a `Unique<Log>` as it is never deallocated.) This is important for allowing the interface to reach its full potential, e.g. serial port debugging before allocation is set up. https://github.com/rust-... | Ah, missed the `rt::at_exit` call. Perhaps the use of `std`, `rt`, and `Box` could be controlled by a cargo feature?
Edit: there is also `eq_ignore_ascii_case` but that doesn't need allocation or anything, so it could be moved defined elsewhere than std?
I submitted a PR for this: #68
| 2016-01-12T19:36:57Z | 0.3 | 1e12cfa3b3ba2a1f1ed80588fd9ebfc3ba46065d |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.