[][src]Macro winconsole::cprintln

macro_rules! cprintln {
    ($color: expr, $fmt:expr) => { ... };
    ($color: expr, $fmt:expr, $($arg:tt)*) => { ... };
}

Prints a colored message to the console with a newline. This has a side effect of flushing the console output.

Examples

#[macro_use] extern crate winconsole;
use winconsole::console;
use winconsole::console::ConsoleColor;

fn main() {
    let person = "Ada";
    print!("Hello, ");
    console::flush_output().unwrap();
    cprintln!(ConsoleColor::Magenta, "{}.", person);
    cprintln!(ConsoleColor::Blue, "How are you?");
}

Panics

Panics if foreground color cannot be retrieved/set, flushing console output fails, or if printing fails.