Skip to content

Commit 49d2837

Browse files
committed
Fix tests & warnings
1 parent 3316e50 commit 49d2837

File tree

2 files changed

+19
-19
lines changed

2 files changed

+19
-19
lines changed

src/builders.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1315,50 +1315,50 @@ impl DateBased {
13151315
/// Containing the date (year, month and day):
13161316
///
13171317
/// ```
1318-
/// # logs/2019-10-23-my-program.log
1318+
/// // logs/2019-10-23-my-program.log
13191319
/// let log = fern::DateBased::new("logs/", "%Y-%m-%d-my-program.log");
13201320
///
1321-
/// # program.log.23102019
1321+
/// // program.log.23102019
13221322
/// let log = fern::DateBased::new("my-program.log.", "%d%m%Y");
13231323
/// ```
13241324
///
13251325
/// Containing the hour:
13261326
///
13271327
/// ```
1328-
/// # logs/2019-10-23 13 my-program.log
1328+
/// // logs/2019-10-23 13 my-program.log
13291329
/// let log = fern::DateBased::new("logs/", "%Y-%m-%d %H my-program.log");
13301330
///
1331-
/// # program.log.2310201913
1331+
/// // program.log.2310201913
13321332
/// let log = fern::DateBased::new("my-program.log.", "%d%m%Y%H");
13331333
/// ```
13341334
///
13351335
/// Containing the minute:
13361336
///
13371337
/// ```
1338-
/// # logs/2019-10-23 13 my-program.log
1338+
/// // logs/2019-10-23 13 my-program.log
13391339
/// let log = fern::DateBased::new("logs/", "%Y-%m-%d %H my-program.log");
13401340
///
1341-
/// # program.log.2310201913
1341+
/// // program.log.2310201913
13421342
/// let log = fern::DateBased::new("my-program.log.", "%d%m%Y%H");
13431343
/// ```
13441344
///
13451345
/// UNIX time, or seconds since 00:00 Jan 1st 1970:
13461346
///
13471347
/// ```
1348-
/// # logs/1571822854-my-program.log
1348+
/// // logs/1571822854-my-program.log
13491349
/// let log = fern::DateBased::new("logs/", "%s-my-program.log");
13501350
///
1351-
/// # program.log.1571822854
1351+
/// // program.log.1571822854
13521352
/// let log = fern::DateBased::new("my-program.log.", "%s");
13531353
/// ```
13541354
///
13551355
/// Hourly, using UTC time:
13561356
///
13571357
/// ```
1358-
/// # logs/2019-10-23 23 my-program.log
1358+
/// // logs/2019-10-23 23 my-program.log
13591359
/// let log = fern::DateBased::new("logs/", "%Y-%m-%d %H my-program.log").utc_time();
13601360
///
1361-
/// # program.log.2310201923
1361+
/// // program.log.2310201923
13621362
/// let log = fern::DateBased::new("my-program.log.", "%d%m%Y%H").utc_time();
13631363
/// ```
13641364
///
@@ -1404,7 +1404,7 @@ impl DateBased {
14041404
/// This will use UTC time to determine the date:
14051405
///
14061406
/// ```
1407-
/// # program.log.2310201923
1407+
/// // program.log.2310201923
14081408
/// let log =
14091409
/// fern::Dispatch::new().chain(fern::DateBased::new("my-program.log.", "%d%m%Y%H").utc_time());
14101410
/// ```
@@ -1423,7 +1423,7 @@ impl DateBased {
14231423
/// former.
14241424
///
14251425
/// ```
1426-
/// # program.log.2310201923
1426+
/// // program.log.2310201923
14271427
/// let log = fern::Dispatch::new().chain(
14281428
/// fern::DateBased::new("my-program.log.", "%d%m%Y%H")
14291429
/// .utc_time()

src/log_impl.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -662,14 +662,14 @@ impl Log for DateBased {
662662
}
663663

664664
fn log(&self, record: &log::Record) {
665-
// Formatting first prevents deadlocks on file-logging,
666-
// when the process of formatting itself is logged.
667-
// note: this is only ever needed if some Debug, Display, or other
668-
// formatting trait itself is logging.
669-
#[cfg(feature = "meta-logging-in-format")]
670-
let msg = format!("{}{}", record.args(), self.config.line_sep);
671-
672665
fallback_on_error(record, |record| {
666+
// Formatting first prevents deadlocks on file-logging,
667+
// when the process of formatting itself is logged.
668+
// note: this is only ever needed if some Debug, Display, or other
669+
// formatting trait itself is logging.
670+
#[cfg(feature = "meta-logging-in-format")]
671+
let msg = format!("{}{}", record.args(), self.config.line_sep);
672+
673673
let mut state = self.state.lock().unwrap_or_else(|e| e.into_inner());
674674

675675
// check if log needs to be rotated

0 commit comments

Comments
 (0)