10 releases (4 breaking)
0.5.7 | Mar 12, 2024 |
---|---|
0.5.6 | Mar 12, 2024 |
0.4.0 | Jan 9, 2024 |
0.3.1 | Nov 26, 2023 |
0.0.2 | Sep 28, 2023 |
#447 in Web programming
51,576 downloads per month
Used in 23 crates
(16 directly)
70KB
1.5K
SLoC
biome_console
The crate contains a general abstraction over printing messages (formatted with markup) and diagnostics to a console.
Usage example
The Console
trait can be used to print two types of information to the user: messages (in the form of markup) and diagnostics:
console.message(markup! {
<Info>"Processed "<Emphasis>{count}</Emphasis>" files"</Info>
});
console.diagnostic(
&mut files,
Diagnostics::error(file_id, code, title),
);
The following markup elements are supported:
Emphasis
: Print the content in bold textDim
: Print the content in dimmed textItalic
: Print the content in italic textUnderline
: Print the content in underlined textError
: Set the text color to redSuccess
: Set the text color to greenWarn
: Set the text color to yellowInfo
: Set the text color to blue
Note: Markup elements that change the "font" of the printed text (Emphasis
, Dim
, Italic
and Underline
) are not supported by the native Windows Console API and will instead get printed as ANSI control codes if the current terminal supports it, or will be ignored entirely
Dependencies
~1.5–9MB
~71K SLoC