[][src]Macro winconsole::cprint

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

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

Examples

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

fn main() {
    let thing = "world";
    cprint!(ConsoleColor::Blue, "Hello, {}!", thing);
    cprint!(ConsoleColor::Red, " Goodbye, world!");
}

Panics

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