Output
Printing to stdout can be done in shrs using println!()
, however it is recommended to use ctx.out
whenever possible.
It provides various print functions that will automatically use the configured out and error colors. Output is also recorded
and can be accessed by hooks through the AfterCommandCtx. print_buf
is also provided to allow users to easily output StyledBuf
.
ctx.out.println("Hello")?;
ctx.out.print_buf(styled_buf!("Hello".red()))?;