Skip to content

Commit 7b97d3f

Browse files
author
rusterize
committed
change feature name to "logging"
1 parent 38ad822 commit 7b97d3f

14 files changed

+36
-35
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ travis-ci = { repository = "rust-lang-nursery/error-chain" }
2121
[features]
2222
default = ["backtrace", "example_generated"]
2323
example_generated = []
24+
logging = ["log"]
2425

2526
[dependencies]
2627
backtrace = { version = "0.3.3", optional = true }

examples/all.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#[cfg(feature = "log")]
1+
#[cfg(feature = "logging")]
22
#[macro_use]
33
extern crate log;
44
#[macro_use]

examples/chain_err.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Demonstrates usage of `Error::caused` method. This method enables chaining errors
22
//! like `ResultExt::chain_err` but doesn't require the presence of a `Result` wrapper.
33
4-
#[cfg(feature = "log")]
4+
#[cfg(feature = "logging")]
55
#[macro_use]
66
extern crate log;
77
#[macro_use]

examples/doc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
//! This module is used to check that all generated items are documented.
44
5-
#[cfg(feature = "log")]
5+
#[cfg(feature = "logging")]
66
#[macro_use]
77
extern crate log;
88
#[macro_use]

examples/quickstart.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
// Import the macro. Don't forget to add `error-chain` in your
88
// `Cargo.toml`!
9-
#[cfg(feature = "log")]
9+
#[cfg(feature = "logging")]
1010
#[macro_use]
1111
extern crate log;
1212
#[macro_use]

examples/size.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#[cfg(feature = "log")]
1+
#[cfg(feature = "logging")]
22
#[macro_use]
33
extern crate log;
44
#[macro_use]

src/bin/has_backtrace.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//! Used by tests to make sure backtraces are available when they should be. Should not be used
33
//! outside of the tests.
44
5-
#[cfg(feature = "log")]
5+
#[cfg(feature = "logging")]
66
#[macro_use]
77
extern crate log;
88
#[macro_use]

src/error_chain.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ macro_rules! impl_error_chain_processed {
383383
}
384384

385385

386-
#[cfg(feature = "log")]
386+
#[cfg(feature = "logging")]
387387
impl_result_log_ext!{ $result_log_ext_name , $error_name }
388388

389389
};

src/lib.rs

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101
//! define an `errors` module and inside it call [`error_chain!`]:
102102
//!
103103
//! ```
104-
//! # #[cfg(feature = "log")]
104+
//! # #[cfg(feature = "logging")]
105105
//! # #[macro_use] extern crate log;
106106
//! # #[macro_use] extern crate error_chain;
107107
//! mod other_error {
@@ -184,7 +184,7 @@
184184
//! Introducing new error chains, with a string message:
185185
//!
186186
//! ```
187-
//! # #[cfg(feature = "log")]
187+
//! # #[cfg(feature = "logging")]
188188
//! # #[macro_use] extern crate log;
189189
//! # #[macro_use] extern crate error_chain;
190190
//! # fn main() {}
@@ -197,7 +197,7 @@
197197
//! Introducing new error chains, with an [`ErrorKind`]:
198198
//!
199199
//! ```
200-
//! # #[cfg(feature = "log")]
200+
//! # #[cfg(feature = "logging")]
201201
//! # #[macro_use] extern crate log;
202202
//! # #[macro_use] extern crate error_chain;
203203
//! # fn main() {}
@@ -222,7 +222,7 @@
222222
//! So the below is equivalent to the previous:
223223
//!
224224
//! ```
225-
//! # #[cfg(feature = "log")]
225+
//! # #[cfg(feature = "logging")]
226226
//! # #[macro_use] extern crate log;
227227
//! # #[macro_use] extern crate error_chain;
228228
//! # fn main() {}
@@ -245,7 +245,7 @@
245245
//! With [`bail!`] the previous examples look like:
246246
//!
247247
//! ```
248-
//! # #[cfg(feature = "log")]
248+
//! # #[cfg(feature = "logging")]
249249
//! # #[macro_use] extern crate log;
250250
//! # #[macro_use] extern crate error_chain;
251251
//! # fn main() {}
@@ -274,7 +274,7 @@
274274
//! To extend the error chain:
275275
//!
276276
//! ```
277-
//! # #[cfg(feature = "log")]
277+
//! # #[cfg(feature = "logging")]
278278
//! # #[macro_use] extern crate log;
279279
//! # #[macro_use] extern crate error_chain;
280280
//! # fn main() {}
@@ -302,7 +302,7 @@
302302
//! To chain an error directly, use [`with_chain`]:
303303
//!
304304
//! ```
305-
//! # #[cfg(feature = "log")]
305+
//! # #[cfg(feature = "logging")]
306306
//! # #[macro_use] extern crate log;
307307
//! # #[macro_use] extern crate error_chain;
308308
//! # fn main() {}
@@ -320,7 +320,7 @@
320320
//! To convert an error from another error chain to this error chain:
321321
//!
322322
//! ```
323-
//! # #[cfg(feature = "log")]
323+
//! # #[cfg(feature = "logging")]
324324
//! # #[macro_use] extern crate log;
325325
//! # #[macro_use] extern crate error_chain;
326326
//! # fn main() {}
@@ -350,7 +350,7 @@
350350
//! making dispatching on error kinds relatively compact:
351351
//!
352352
//! ```
353-
//! # #[cfg(feature = "log")]
353+
//! # #[cfg(feature = "logging")]
354354
//! # #[macro_use] extern crate log;
355355
//! # #[macro_use] extern crate error_chain;
356356
//! # fn main() {
@@ -374,7 +374,7 @@
374374
//! Chained errors are also matched with (relatively) compact syntax
375375
//!
376376
//! ```
377-
//! # #[cfg(feature = "log")]
377+
//! # #[cfg(feature = "logging")]
378378
//! # #[macro_use] extern crate log;
379379
//! # #[macro_use] extern crate error_chain;
380380
//! mod utils {
@@ -410,7 +410,7 @@
410410
//! of causing errors. For reporting purposes, this information can be accessed as follows.
411411
//!
412412
//! ```
413-
//! # #[cfg(feature = "log")]
413+
//! # #[cfg(feature = "logging")]
414414
//! # #[macro_use] extern crate log;
415415
//! # #[macro_use] extern crate error_chain;
416416
//! use error_chain::ChainedError; // for e.display_chain()
@@ -488,7 +488,7 @@
488488
//! within your own project.
489489
//!
490490
//! ```
491-
//! # #[cfg(feature = "log")]
491+
//! # #[cfg(feature = "logging")]
492492
//! # #[macro_use] extern crate log;
493493
//! # #[macro_use]
494494
//! # extern crate error_chain;
@@ -564,7 +564,7 @@ use std::error;
564564
use std::iter::Iterator;
565565
use std::fmt;
566566

567-
#[cfg(feature = "log")]
567+
#[cfg(feature = "logging")]
568568
#[macro_use]
569569
extern crate log;
570570

@@ -723,7 +723,7 @@ impl State {
723723
/// `bail!(expr)` is equivalent to writing.
724724
///
725725
/// ```
726-
/// # #[cfg(feature = "log")]
726+
/// # #[cfg(feature = "logging")]
727727
/// # #[macro_use] extern crate log;
728728
/// # #[macro_use] extern crate error_chain;
729729
/// # error_chain! { }
@@ -737,7 +737,7 @@ impl State {
737737
/// And as shorthand it takes a formatting string a la `println!`:
738738
///
739739
/// ```
740-
/// # #[cfg(feature = "log")]
740+
/// # #[cfg(feature = "logging")]
741741
/// # #[macro_use] extern crate log;
742742
/// # #[macro_use] extern crate error_chain;
743743
/// # error_chain! { }
@@ -753,7 +753,7 @@ impl State {
753753
/// Bailing on a custom error:
754754
///
755755
/// ```
756-
/// # #[cfg(feature = "log")]
756+
/// # #[cfg(feature = "logging")]
757757
/// # #[macro_use] extern crate log;
758758
/// # #[macro_use] extern crate error_chain;
759759
/// # fn main() {}
@@ -775,7 +775,7 @@ impl State {
775775
/// Bailing on a formatted string:
776776
///
777777
/// ```
778-
/// # #[cfg(feature = "log")]
778+
/// # #[cfg(feature = "logging")]
779779
/// # #[macro_use] extern crate log;
780780
/// # #[macro_use] extern crate error_chain;
781781
/// # fn main() {}
@@ -809,7 +809,7 @@ macro_rules! bail {
809809
/// As an example, `ensure!(condition, "error code: {}", errcode)` is equivalent to
810810
///
811811
/// ```
812-
/// # #[cfg(feature = "log")]
812+
/// # #[cfg(feature = "logging")]
813813
/// # #[macro_use] extern crate log;
814814
/// # #[macro_use] extern crate error_chain;
815815
/// # error_chain! { }

src/log_ext.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#[cfg(feature = "log")]
1+
#[cfg(feature = "logging")]
22
#[macro_use]
33
mod impl_log_ext {
44
#[macro_export]
@@ -45,7 +45,7 @@ macro_rules! impl_result_log_ext {
4545
/// For example:
4646
///
4747
/// `log_causes!(err,info)`
48-
// #[cfg(feature = "log")]
48+
// #[cfg(feature = "logging")]
4949
#[macro_export]
5050
macro_rules! impl_log_causes {
5151
($e:expr, $level:ident) => (
@@ -71,7 +71,7 @@ macro_rules! impl_log_causes {
7171
/// For example:
7272
///
7373
/// `log_error!(err,info,Info)`
74-
#[cfg(feature = "log")]
74+
#[cfg(feature = "logging")]
7575
#[macro_export]
7676
macro_rules! impl_make_log_fn_for_result {
7777
($name:ident, $level:ident, $lvlchk:ident) => (
@@ -89,7 +89,7 @@ macro_rules! impl_make_log_fn_for_result {
8989
}
9090

9191
/// Internal implementation macro for logging the chained error type
92-
#[cfg(feature = "log")]
92+
#[cfg(feature = "logging")]
9393
#[macro_export]
9494
macro_rules! impl_make_log_fn_for_chained_error {
9595
($name:ident, $level:ident, $lvlchk:ident) => (

src/quick_main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
/// Err("error".into())
3939
/// }
4040
/// ```
41-
#[cfg(features = "log")]
41+
#[cfg(features = "logging")]
4242
#[macro_use]
4343
extern crate log;
4444

tests/log_ext.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
#![allow(dead_code)]
22

3-
#[cfg(feature = "log")]
3+
#[cfg(feature = "logging")]
44
#[macro_use]
55
extern crate log;
66

7-
#[cfg(feature = "log")]
7+
#[cfg(feature = "logging")]
88
#[macro_use]
99
extern crate error_chain;
1010

11-
#[cfg(feature = "log")]
11+
#[cfg(feature = "logging")]
1212
#[cfg(test)]
1313
mod log_ext_tests {
1414

tests/quick_main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#![allow(dead_code)]
2-
#[cfg(feature = "log")]
2+
#[cfg(feature = "logging")]
33
#[macro_use]
44
extern crate log;
55
#[macro_use]

tests/tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#![allow(dead_code)]
22

3-
#[cfg(feature = "log")]
3+
#[cfg(feature = "logging")]
44
#[macro_use]
55
extern crate log;
66

0 commit comments

Comments
 (0)