From 97e521dac76c14abfc1aee57bcb317e3d1b16f00 Mon Sep 17 00:00:00 2001
From: clux <sszynrae@gmail.com>
Date: Mon, 19 Aug 2019 08:27:22 +0100
Subject: [PATCH] fix wrong default colors tests #22
---
src/lib.rs | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/src/lib.rs b/src/lib.rs
index c2cf3668..24044da9 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -465,18 +465,18 @@ impl Logger {
self
}
- /// Sets the module path filter list.
- ///
+ /// Sets the module path filter list.
+ ///
/// When any filter is matched as prefix of the log statement module path, the log
/// statement will be logged if log level allows.
/// Log statements not maching any filter will not be logged.
- ///
- /// When not set (default) or set to empty Vec log statements will not be filtered
+ ///
+ /// When not set (default) or set to empty Vec log statements will not be filtered
/// by the module path.
- ///
+ ///
/// # Example
/// Log only messages comming from this program.
- ///
+ ///
/// ```rust
/// #[macro_use] extern crate log;
/// extern crate loggerv;
@@ -496,17 +496,17 @@ impl Logger {
}
/// Adds module path filter to the list of module path filters.
- ///
+ ///
/// When any filter is matched as prefix of the log statement module path, the log
/// statement will be logged if log level allows.
/// Log statements not maching any filter will not be logged.
- ///
- /// When not filters were added log statements will not be filtered
+ ///
+ /// When not filters were added log statements will not be filtered
/// by the module path.
- ///
+ ///
/// # Example
/// Log only messages comming from this program.
- ///
+ ///
/// ```rust
/// #[macro_use] extern crate log;
/// extern crate loggerv;
@@ -876,7 +876,7 @@ mod tests {
assert_eq!(logger.include_level, DEFAULT_INCLUDE_LEVEL);
assert_eq!(logger.include_line_numbers, DEFAULT_INCLUDE_LINE_NUMBERS);
assert_eq!(logger.include_module_path, DEFAULT_INCLUDE_MODULE_PATH);
- assert_eq!(logger.colors, DEFAULT_COLORS);
+ assert_eq!(logger.colors, DEFAULT_COLORS && atty::is(atty::Stream::Stdout) && atty::is(atty::Stream::Stderr));
assert_eq!(logger.level, DEFAULT_LEVEL);
assert_eq!(logger.separator, String::from(DEFAULT_SEPARATOR));
assert_eq!(logger.error.color, DEFAULT_ERROR_COLOR);
--
2.23.0.rc2