413 Commits

Author SHA1 Message Date
Thayne McCombs
506167c3e7 Add impls for Source for HashMap and BTreeMap 2019-07-01 12:24:00 -06:00
Ashley Mannix
569175ef4d
Merge pull request #335 from KodrAus/feat/source-get
Add a Source::get method for finding a single value
2019-07-01 10:12:17 +10:00
Ashley Mannix
11ba139652 add a Source::get method for finding a single value 2019-06-28 13:03:16 +10:00
Steven Fackler
8dbb2f51e9
Merge pull request #333 from johndrinkwater/master
Respect padding for LevelFilter Display
2019-05-16 09:22:37 -07:00
John Drinkwater
f9eb14c8a1 Respect padding for LevelFilter Display
This mirrors a similar commit fe073054a0999d1bb238cb0293757741e95b3588
that changed output for Level, it seems sensible if the user wishes to
output the logging filter level to afford the same formatting choices.
2019-05-16 11:10:40 +01:00
David Tolnay
5213657b81
Switch to SPDX 2.1 license expression 2019-05-09 15:33:21 -07:00
Ashley Mannix
533662d167
Merge pull request #330 from dtolnay/edition
Update documentation to 2018 edition
2019-05-01 08:14:54 +10:00
David Tolnay
0f3ffb9d05
Update documentation to 2018 edition 2019-04-30 01:33:31 -07:00
David Tolnay
41193b9223
Clean up trailing whitespace 2019-04-30 01:33:21 -07:00
Ashley Mannix
cd690d1607
Add a count method to Source (#329) 2019-04-30 12:16:50 +10:00
Ashley Mannix
84fffab7f0
Build out initial key values API (#324) 2019-04-29 14:32:30 +10:00
Steven Fackler
75043f9ba3
Merge pull request #325 from jonas-schievink/thumbv6
Thumbv6 support
2019-03-28 09:01:48 -07:00
Jonas Schievink
0f4bdaa17a Address documentation nits 2019-03-25 11:14:15 +01:00
Jonas Schievink
3d9bf60ff4 Clarify safety conditions of set_logger_racy 2019-03-19 13:21:04 +01:00
Jonas Schievink
ee8b8c6962 Don't test thumbv6 support on 1.16.0 2019-03-18 23:43:06 +01:00
Jonas Schievink
08ed9b3b00 Test thumbv6 support on Travis 2019-03-18 23:13:07 +01:00
Jonas Schievink
b74bc7821f Support thumbv6 by providing a thread-unsafe initialization function 2019-03-18 23:13:07 +01:00
David Tolnay
b782a88236
Merge pull request #323 from Enet4/patch-1
Update Cargo.toml
2019-03-12 15:05:33 -07:00
Eduardo Pinho
51cfe57667
Update Cargo.toml
remove homepage field (C-METADATA)
2019-03-12 21:56:10 +00:00
Ashley Mannix
74584a57ac
An RFC for structured logging (#296) 2019-03-11 09:23:05 +10:00
David Tolnay
ce64c06a37
Format with rustfmt 2019-02-14 2019-03-09 16:15:10 -08:00
David Tolnay
f8522dbeb6
Merge pull request #322 from dtolnay/missing
Improve error when missing macro argument
2019-03-09 16:12:08 -08:00
David Tolnay
c69948d391
Improve error when missing macro argument
The log! macro matches part of its arguments as $($arg:tt)+, but the other
macros match it as $($arg:tt)*. That means if a user calls error!() or any of
the other macros with an empty argument, it successfully matches the macro rules
of the first macro they called but then turns into an invalid call to log!,
leading to a confusing error message.

This PR uses $($arg:tt)+ consistently to match arguments.

Example:

    use log::error;

    fn main() {
        error!();
    }

Before:

    error: expected identifier, found `,`
     --> src/main.rs:4:5
      |
    4 |     error!();
      |     ^^^^^^^^^
      |     |
      |     expected identifier
      |     help: remove this comma
      |
      = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

After:

    error: unexpected end of macro invocation
     --> src/main.rs:4:5
      |
    4 |     error!();
      |     ^^^^^^^^^ missing tokens in macro arguments
2019-03-09 15:51:46 -08:00
Ashley Mannix
7d7daf6258
Merge pull request #321 from dekellum/ignore-atomic-init-depr
Silence deprecation warning for ATOMIC_USIZE_INIT
2019-02-04 07:02:40 +10:00
David Kellum
48dcb095f6 Silence deprecation warning for ATOMIC_USIZE_INIT
ATOMIC_USIZE_INIT was deprecated in rust 1.34. Silence the deprecation
warning until our MSRV >= 1.24, where we can use the replacement const
fn `AtomicUsize::new`

github: fixes #320
2019-02-03 09:24:34 -08:00
Steven Fackler
feac7b7af2
Merge pull request #319 from dekellum/fix-max-level-features-warning
Move max_level_features project out of tests to avoid warning
2019-02-01 20:24:50 -08:00
David Kellum
9b48836440 Move max_level_features project out of tests to avoid warning
fixes: #270
2019-02-01 16:35:01 -08:00
Ashley Mannix
d9f8141a39
Merge pull request #315 from fitzgen/wasm
README: Add `console_log` implementation for WebAssembly
2019-01-15 10:34:57 +10:00
Nick Fitzgerald
10d6e16d21 README: Add console_log implementation for WebAssembly 2019-01-14 15:41:28 -08:00
Ashley Mannix
4337316374
Add minimum version policy to readme (#313) 2019-01-04 10:06:47 +10:00
Ashley Mannix
3333c0340c
Merge pull request #311 from KodrAus/doc/max-level-features
Add a note to avoid setting max levels
2019-01-02 13:45:21 +10:00
Ashley Mannix
3a50f25acf add a note to avoid setting max levels 2019-01-02 09:55:49 +10:00
Steven Fackler
90229b3077
Merge pull request #305 from rust-lang-nursery/KodrAus-patch-1
Clarify what 2018 edition is a bit
2018-11-01 17:55:13 -07:00
Ashley Mannix
7f5f2a7cb7
clarify what 2018 edition is a bit 2018-11-02 10:44:42 +10:00
David Tolnay
3493b96aa3
Merge pull request #304 from svenstaro/patch-1
Add comma to make parsing this easier
2018-10-30 12:12:33 -07:00
Sven-Hendrik Haase
fb6ff6f746
Add comma to make parsing this easier
It was a pretty tough read before ;)
2018-10-30 20:03:07 +01:00
David Tolnay
88dcddddd9
Merge pull request #299 from ignatenkobrain/patch-1
exclude CI files from crates.io
2018-10-27 13:30:23 -07:00
David Tolnay
426c20cf29
Update Cargo.toml
Co-Authored-By: ignatenkobrain <i.gnatenko.brain@gmail.com>
2018-10-27 22:27:18 +02:00
David Tolnay
1a9a8275f5
Release 0.4.6 0.4.6 2018-10-27 12:05:53 -07:00
David Tolnay
a7a25c1613
Merge pull request #301 from faern/fix-log-enabled-macro-export
Fix so log_enabled can be used without #[macro_use]
2018-10-27 11:57:51 -07:00
Linus Färnstrand
2f52d6ce91 Fix so log_enabled can be used without #[macro_use] 2018-10-27 20:52:10 +02:00
Igor Gnatenko
8e4b880934
exclude CI files from crates.io 2018-10-26 22:44:02 +02:00
Ashley Mannix
5f3cb9e144
Merge pull request #295 from dereckson/rust-2018-readme
Document how to use the crate with Rust 2018
2018-10-12 09:05:18 +10:00
Sébastien Santoro
0da4245527 Document how to use the crate with Rust 2018
Fixes #294.
2018-10-10 11:51:12 +00:00
David Tolnay
d711a6bf48
Release 0.4.5 0.4.5 2018-09-03 08:58:33 -07:00
David Tolnay
9b30cbb010
Merge pull request #292 from dtolnay/private
Make private helper macro names less likely to conflict
2018-09-03 08:56:50 -07:00
David Tolnay
da920f8637
Make private helper macro names less likely to conflict 2018-09-03 08:05:47 -07:00
David Tolnay
5602967f47
Release 0.4.4 0.4.4 2018-08-17 07:51:52 -07:00
Alex Crichton
88983eb42a
Merge pull request #288 from dtolnay/local
Use local_inner_macros to resolve all local macros within $crate
2018-08-17 07:32:48 -07:00
David Tolnay
11dfde1a29
Use local_inner_macros to resolve all local macros within $crate
This fixes the following error when using Rust 2018 style macro imports.

    use log::info;

    fn main() {
        info!("...");
    }

    error: cannot find macro `log!` in this scope
     --> src/main.rs:4:5
      |
    4 |     info!("...");
      |     ^^^^^^^^^^^^^

The `local_inner_macros` modifier resolves all macro invocations made
from within that macro as macros in the same crate. So if `info!`
expands to an invocation of `log!` then this would be resolved as
`$crate::log!` rather than requiring the caller to have `log` in scope.

The attribute is ignored by pre-2018 compilers so log will continue to
work as normal with #[macro_use].

In the future when dropping compatibility with pre-2018 compilers we can
remove the `local_inner_macros` modifier and use our own explicit
`$crate::` prefixes on invocations of local macros.
2018-08-16 23:55:56 -07:00