File: support.rs

package info (click to toggle)
rust-fern 0.7.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 652 kB
  • sloc: makefile: 2
file content (17 lines) | stat: -rw-r--r-- 445 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//! Support module for tests
use std::fmt;

/// Utility to manually enter a log message into a logger. All extra metadata
/// (target, line number, etc) will be blank.
pub fn manual_log<T, U>(logger: &T, level: log::Level, message: U)
where
    T: log::Log + ?Sized,
    U: fmt::Display,
{
    logger.log(
        &log::RecordBuilder::new()
            .args(format_args!("{}", message))
            .level(level)
            .build(),
    );
}