error

Function error 

Source
pub fn error(s: impl AsRef<str>)
Expand description

Print an error to the global writer without state

use bullet_stream::global::print;
use indoc::formatdoc;

print::error(formatdoc! {"
    It's at times like this, when I'm trapped in a Vogon
    airlock with a man from Betelgeuse, and about to die of asphyxiation
    in deep space that I really wish I'd listened to what my mother told
    me when I was young
"});

let expected = indoc::formatdoc!{"

  ! It's at times like this, when I'm trapped in a Vogon
  ! airlock with a man from Betelgeuse, and about to die of asphyxiation
  ! in deep space that I really wish I'd listened to what my mother told
  ! me when I was young

"};
assert_eq!(expected, bullet_stream::strip_ansi(String::from_utf8_lossy(&output)));