#[non_exhaustive]pub struct SpanAttributesBuilder { /* private fields */ }Expand description
A builder for SpanAttributes.
Implementations§
Source§impl SpanAttributesBuilder
impl SpanAttributesBuilder
Sourcepub fn operation_name(self, input: impl Into<String>) -> Self
pub fn operation_name(self, input: impl Into<String>) -> Self
Action being performed
Sourcepub fn set_operation_name(self, input: Option<String>) -> Self
pub fn set_operation_name(self, input: Option<String>) -> Self
Action being performed
Sourcepub fn get_operation_name(&self) -> &Option<String>
pub fn get_operation_name(&self) -> &Option<String>
Action being performed
Sourcepub fn provider_name(self, input: impl Into<String>) -> Self
pub fn provider_name(self, input: impl Into<String>) -> Self
Model provider identifier (e.g., aws.bedrock)
Sourcepub fn set_provider_name(self, input: Option<String>) -> Self
pub fn set_provider_name(self, input: Option<String>) -> Self
Model provider identifier (e.g., aws.bedrock)
Sourcepub fn get_provider_name(&self) -> &Option<String>
pub fn get_provider_name(&self) -> &Option<String>
Model provider identifier (e.g., aws.bedrock)
Sourcepub fn error_type(self, input: impl Into<String>) -> Self
pub fn error_type(self, input: impl Into<String>) -> Self
Error classification if span failed (e.g., throttle, timeout)
Sourcepub fn set_error_type(self, input: Option<String>) -> Self
pub fn set_error_type(self, input: Option<String>) -> Self
Error classification if span failed (e.g., throttle, timeout)
Sourcepub fn get_error_type(&self) -> &Option<String>
pub fn get_error_type(&self) -> &Option<String>
Error classification if span failed (e.g., throttle, timeout)
Sourcepub fn set_agent_id(self, input: Option<String>) -> Self
pub fn set_agent_id(self, input: Option<String>) -> Self
Amazon Connect agent ID
Sourcepub fn get_agent_id(&self) -> &Option<String>
pub fn get_agent_id(&self) -> &Option<String>
Amazon Connect agent ID
Sourcepub fn instance_arn(self, input: impl Into<String>) -> Self
pub fn instance_arn(self, input: impl Into<String>) -> Self
Amazon Connect instance ARN
Sourcepub fn set_instance_arn(self, input: Option<String>) -> Self
pub fn set_instance_arn(self, input: Option<String>) -> Self
Amazon Connect instance ARN
Sourcepub fn get_instance_arn(&self) -> &Option<String>
pub fn get_instance_arn(&self) -> &Option<String>
Amazon Connect instance ARN
Sourcepub fn contact_id(self, input: impl Into<String>) -> Self
pub fn contact_id(self, input: impl Into<String>) -> Self
Amazon Connect contact identifier
Sourcepub fn set_contact_id(self, input: Option<String>) -> Self
pub fn set_contact_id(self, input: Option<String>) -> Self
Amazon Connect contact identifier
Sourcepub fn get_contact_id(&self) -> &Option<String>
pub fn get_contact_id(&self) -> &Option<String>
Amazon Connect contact identifier
Sourcepub fn initial_contact_id(self, input: impl Into<String>) -> Self
pub fn initial_contact_id(self, input: impl Into<String>) -> Self
Amazon Connect contact identifier
Sourcepub fn set_initial_contact_id(self, input: Option<String>) -> Self
pub fn set_initial_contact_id(self, input: Option<String>) -> Self
Amazon Connect contact identifier
Sourcepub fn get_initial_contact_id(&self) -> &Option<String>
pub fn get_initial_contact_id(&self) -> &Option<String>
Amazon Connect contact identifier
Sourcepub fn session_name(self, input: impl Into<String>) -> Self
pub fn session_name(self, input: impl Into<String>) -> Self
Session name
Sourcepub fn set_session_name(self, input: Option<String>) -> Self
pub fn set_session_name(self, input: Option<String>) -> Self
Session name
Sourcepub fn get_session_name(&self) -> &Option<String>
pub fn get_session_name(&self) -> &Option<String>
Session name
Sourcepub fn ai_agent_arn(self, input: impl Into<String>) -> Self
pub fn ai_agent_arn(self, input: impl Into<String>) -> Self
AI agent ARN
Sourcepub fn set_ai_agent_arn(self, input: Option<String>) -> Self
pub fn set_ai_agent_arn(self, input: Option<String>) -> Self
AI agent ARN
Sourcepub fn get_ai_agent_arn(&self) -> &Option<String>
pub fn get_ai_agent_arn(&self) -> &Option<String>
AI agent ARN
Sourcepub fn ai_agent_type(self, input: AiAgentType) -> Self
pub fn ai_agent_type(self, input: AiAgentType) -> Self
AI agent type
Sourcepub fn set_ai_agent_type(self, input: Option<AiAgentType>) -> Self
pub fn set_ai_agent_type(self, input: Option<AiAgentType>) -> Self
AI agent type
Sourcepub fn get_ai_agent_type(&self) -> &Option<AiAgentType>
pub fn get_ai_agent_type(&self) -> &Option<AiAgentType>
AI agent type
Sourcepub fn ai_agent_name(self, input: impl Into<String>) -> Self
pub fn ai_agent_name(self, input: impl Into<String>) -> Self
AI agent name
Sourcepub fn set_ai_agent_name(self, input: Option<String>) -> Self
pub fn set_ai_agent_name(self, input: Option<String>) -> Self
AI agent name
Sourcepub fn get_ai_agent_name(&self) -> &Option<String>
pub fn get_ai_agent_name(&self) -> &Option<String>
AI agent name
Sourcepub fn ai_agent_id(self, input: impl Into<String>) -> Self
pub fn ai_agent_id(self, input: impl Into<String>) -> Self
AI agent identifier
Sourcepub fn set_ai_agent_id(self, input: Option<String>) -> Self
pub fn set_ai_agent_id(self, input: Option<String>) -> Self
AI agent identifier
Sourcepub fn get_ai_agent_id(&self) -> &Option<String>
pub fn get_ai_agent_id(&self) -> &Option<String>
AI agent identifier
Sourcepub fn ai_agent_version(self, input: i32) -> Self
pub fn ai_agent_version(self, input: i32) -> Self
AI agent version number
Sourcepub fn set_ai_agent_version(self, input: Option<i32>) -> Self
pub fn set_ai_agent_version(self, input: Option<i32>) -> Self
AI agent version number
Sourcepub fn get_ai_agent_version(&self) -> &Option<i32>
pub fn get_ai_agent_version(&self) -> &Option<i32>
AI agent version number
Sourcepub fn ai_agent_invoker(self, input: impl Into<String>) -> Self
pub fn ai_agent_invoker(self, input: impl Into<String>) -> Self
Entity that invoked the AI agent
Sourcepub fn set_ai_agent_invoker(self, input: Option<String>) -> Self
pub fn set_ai_agent_invoker(self, input: Option<String>) -> Self
Entity that invoked the AI agent
Sourcepub fn get_ai_agent_invoker(&self) -> &Option<String>
pub fn get_ai_agent_invoker(&self) -> &Option<String>
Entity that invoked the AI agent
Sourcepub fn ai_agent_orchestrator_use_case(self, input: impl Into<String>) -> Self
pub fn ai_agent_orchestrator_use_case(self, input: impl Into<String>) -> Self
AI agent orchestrator use case
Sourcepub fn set_ai_agent_orchestrator_use_case(self, input: Option<String>) -> Self
pub fn set_ai_agent_orchestrator_use_case(self, input: Option<String>) -> Self
AI agent orchestrator use case
Sourcepub fn get_ai_agent_orchestrator_use_case(&self) -> &Option<String>
pub fn get_ai_agent_orchestrator_use_case(&self) -> &Option<String>
AI agent orchestrator use case
Sourcepub fn request_model(self, input: impl Into<String>) -> Self
pub fn request_model(self, input: impl Into<String>) -> Self
LLM model ID for request (e.g., anthropic.claude-3-sonnet)
Sourcepub fn set_request_model(self, input: Option<String>) -> Self
pub fn set_request_model(self, input: Option<String>) -> Self
LLM model ID for request (e.g., anthropic.claude-3-sonnet)
Sourcepub fn get_request_model(&self) -> &Option<String>
pub fn get_request_model(&self) -> &Option<String>
LLM model ID for request (e.g., anthropic.claude-3-sonnet)
Sourcepub fn request_max_tokens(self, input: i32) -> Self
pub fn request_max_tokens(self, input: i32) -> Self
Maximum tokens configured for generation
Sourcepub fn set_request_max_tokens(self, input: Option<i32>) -> Self
pub fn set_request_max_tokens(self, input: Option<i32>) -> Self
Maximum tokens configured for generation
Sourcepub fn get_request_max_tokens(&self) -> &Option<i32>
pub fn get_request_max_tokens(&self) -> &Option<i32>
Maximum tokens configured for generation
Sourcepub fn temperature(self, input: f32) -> Self
pub fn temperature(self, input: f32) -> Self
Sampling temperature for generation
Sourcepub fn set_temperature(self, input: Option<f32>) -> Self
pub fn set_temperature(self, input: Option<f32>) -> Self
Sampling temperature for generation
Sourcepub fn get_temperature(&self) -> &Option<f32>
pub fn get_temperature(&self) -> &Option<f32>
Sampling temperature for generation
Sourcepub fn response_model(self, input: impl Into<String>) -> Self
pub fn response_model(self, input: impl Into<String>) -> Self
Actual model used for response (usually matches requestModel)
Sourcepub fn set_response_model(self, input: Option<String>) -> Self
pub fn set_response_model(self, input: Option<String>) -> Self
Actual model used for response (usually matches requestModel)
Sourcepub fn get_response_model(&self) -> &Option<String>
pub fn get_response_model(&self) -> &Option<String>
Actual model used for response (usually matches requestModel)
Sourcepub fn response_finish_reasons(self, input: impl Into<String>) -> Self
pub fn response_finish_reasons(self, input: impl Into<String>) -> Self
Appends an item to response_finish_reasons.
To override the contents of this collection use set_response_finish_reasons.
Generation termination reasons (e.g., stop, max_tokens)
Sourcepub fn set_response_finish_reasons(self, input: Option<Vec<String>>) -> Self
pub fn set_response_finish_reasons(self, input: Option<Vec<String>>) -> Self
Generation termination reasons (e.g., stop, max_tokens)
Sourcepub fn get_response_finish_reasons(&self) -> &Option<Vec<String>>
pub fn get_response_finish_reasons(&self) -> &Option<Vec<String>>
Generation termination reasons (e.g., stop, max_tokens)
Sourcepub fn usage_input_tokens(self, input: i32) -> Self
pub fn usage_input_tokens(self, input: i32) -> Self
Number of input tokens in prompt
Sourcepub fn set_usage_input_tokens(self, input: Option<i32>) -> Self
pub fn set_usage_input_tokens(self, input: Option<i32>) -> Self
Number of input tokens in prompt
Sourcepub fn get_usage_input_tokens(&self) -> &Option<i32>
pub fn get_usage_input_tokens(&self) -> &Option<i32>
Number of input tokens in prompt
Sourcepub fn usage_output_tokens(self, input: i32) -> Self
pub fn usage_output_tokens(self, input: i32) -> Self
Number of output tokens in response
Sourcepub fn set_usage_output_tokens(self, input: Option<i32>) -> Self
pub fn set_usage_output_tokens(self, input: Option<i32>) -> Self
Number of output tokens in response
Sourcepub fn get_usage_output_tokens(&self) -> &Option<i32>
pub fn get_usage_output_tokens(&self) -> &Option<i32>
Number of output tokens in response
Sourcepub fn usage_total_tokens(self, input: i32) -> Self
pub fn usage_total_tokens(self, input: i32) -> Self
Total tokens consumed (input + output)
Sourcepub fn set_usage_total_tokens(self, input: Option<i32>) -> Self
pub fn set_usage_total_tokens(self, input: Option<i32>) -> Self
Total tokens consumed (input + output)
Sourcepub fn get_usage_total_tokens(&self) -> &Option<i32>
pub fn get_usage_total_tokens(&self) -> &Option<i32>
Total tokens consumed (input + output)
Sourcepub fn cache_read_input_tokens(self, input: i32) -> Self
pub fn cache_read_input_tokens(self, input: i32) -> Self
Number of input tokens that were retrieved from cache
Sourcepub fn set_cache_read_input_tokens(self, input: Option<i32>) -> Self
pub fn set_cache_read_input_tokens(self, input: Option<i32>) -> Self
Number of input tokens that were retrieved from cache
Sourcepub fn get_cache_read_input_tokens(&self) -> &Option<i32>
pub fn get_cache_read_input_tokens(&self) -> &Option<i32>
Number of input tokens that were retrieved from cache
Sourcepub fn cache_write_input_tokens(self, input: i32) -> Self
pub fn cache_write_input_tokens(self, input: i32) -> Self
Number of input tokens that were written to cache in this request
Sourcepub fn set_cache_write_input_tokens(self, input: Option<i32>) -> Self
pub fn set_cache_write_input_tokens(self, input: Option<i32>) -> Self
Number of input tokens that were written to cache in this request
Sourcepub fn get_cache_write_input_tokens(&self) -> &Option<i32>
pub fn get_cache_write_input_tokens(&self) -> &Option<i32>
Number of input tokens that were written to cache in this request
Sourcepub fn input_messages(self, input: SpanMessage) -> Self
pub fn input_messages(self, input: SpanMessage) -> Self
Appends an item to input_messages.
To override the contents of this collection use set_input_messages.
Input message collection sent to LLM
Sourcepub fn set_input_messages(self, input: Option<Vec<SpanMessage>>) -> Self
pub fn set_input_messages(self, input: Option<Vec<SpanMessage>>) -> Self
Input message collection sent to LLM
Sourcepub fn get_input_messages(&self) -> &Option<Vec<SpanMessage>>
pub fn get_input_messages(&self) -> &Option<Vec<SpanMessage>>
Input message collection sent to LLM
Sourcepub fn output_messages(self, input: SpanMessage) -> Self
pub fn output_messages(self, input: SpanMessage) -> Self
Appends an item to output_messages.
To override the contents of this collection use set_output_messages.
Output message collection received from LLM
Sourcepub fn set_output_messages(self, input: Option<Vec<SpanMessage>>) -> Self
pub fn set_output_messages(self, input: Option<Vec<SpanMessage>>) -> Self
Output message collection received from LLM
Sourcepub fn get_output_messages(&self) -> &Option<Vec<SpanMessage>>
pub fn get_output_messages(&self) -> &Option<Vec<SpanMessage>>
Output message collection received from LLM
Sourcepub fn system_instructions(self, input: SpanMessageValue) -> Self
pub fn system_instructions(self, input: SpanMessageValue) -> Self
Appends an item to system_instructions.
To override the contents of this collection use set_system_instructions.
System prompt instructions
Sourcepub fn set_system_instructions(
self,
input: Option<Vec<SpanMessageValue>>,
) -> Self
pub fn set_system_instructions( self, input: Option<Vec<SpanMessageValue>>, ) -> Self
System prompt instructions
Sourcepub fn get_system_instructions(&self) -> &Option<Vec<SpanMessageValue>>
pub fn get_system_instructions(&self) -> &Option<Vec<SpanMessageValue>>
System prompt instructions
Sourcepub fn prompt_arn(self, input: impl Into<String>) -> Self
pub fn prompt_arn(self, input: impl Into<String>) -> Self
AI prompt ARN
Sourcepub fn set_prompt_arn(self, input: Option<String>) -> Self
pub fn set_prompt_arn(self, input: Option<String>) -> Self
AI prompt ARN
Sourcepub fn get_prompt_arn(&self) -> &Option<String>
pub fn get_prompt_arn(&self) -> &Option<String>
AI prompt ARN
Sourcepub fn set_prompt_id(self, input: Option<String>) -> Self
pub fn set_prompt_id(self, input: Option<String>) -> Self
AI prompt identifier
Sourcepub fn get_prompt_id(&self) -> &Option<String>
pub fn get_prompt_id(&self) -> &Option<String>
AI prompt identifier
Sourcepub fn prompt_type(self, input: AiPromptType) -> Self
pub fn prompt_type(self, input: AiPromptType) -> Self
AI prompt type
Sourcepub fn set_prompt_type(self, input: Option<AiPromptType>) -> Self
pub fn set_prompt_type(self, input: Option<AiPromptType>) -> Self
AI prompt type
Sourcepub fn get_prompt_type(&self) -> &Option<AiPromptType>
pub fn get_prompt_type(&self) -> &Option<AiPromptType>
AI prompt type
Sourcepub fn prompt_name(self, input: impl Into<String>) -> Self
pub fn prompt_name(self, input: impl Into<String>) -> Self
AI prompt name
Sourcepub fn set_prompt_name(self, input: Option<String>) -> Self
pub fn set_prompt_name(self, input: Option<String>) -> Self
AI prompt name
Sourcepub fn get_prompt_name(&self) -> &Option<String>
pub fn get_prompt_name(&self) -> &Option<String>
AI prompt name
Sourcepub fn prompt_version(self, input: i32) -> Self
pub fn prompt_version(self, input: i32) -> Self
AI prompt version number
Sourcepub fn set_prompt_version(self, input: Option<i32>) -> Self
pub fn set_prompt_version(self, input: Option<i32>) -> Self
AI prompt version number
Sourcepub fn get_prompt_version(&self) -> &Option<i32>
pub fn get_prompt_version(&self) -> &Option<i32>
AI prompt version number
Sourcepub fn build(self) -> SpanAttributes
pub fn build(self) -> SpanAttributes
Consumes the builder and constructs a SpanAttributes.
Trait Implementations§
Source§impl Clone for SpanAttributesBuilder
impl Clone for SpanAttributesBuilder
Source§fn clone(&self) -> SpanAttributesBuilder
fn clone(&self) -> SpanAttributesBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SpanAttributesBuilder
impl Debug for SpanAttributesBuilder
Source§impl Default for SpanAttributesBuilder
impl Default for SpanAttributesBuilder
Source§fn default() -> SpanAttributesBuilder
fn default() -> SpanAttributesBuilder
Source§impl PartialEq for SpanAttributesBuilder
impl PartialEq for SpanAttributesBuilder
impl StructuralPartialEq for SpanAttributesBuilder
Auto Trait Implementations§
impl Freeze for SpanAttributesBuilder
impl RefUnwindSafe for SpanAttributesBuilder
impl Send for SpanAttributesBuilder
impl Sync for SpanAttributesBuilder
impl Unpin for SpanAttributesBuilder
impl UnwindSafe for SpanAttributesBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
Source§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the foreground set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red() and
green(), which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg():
use yansi::{Paint, Color};
painted.fg(Color::White);Set foreground color to white using white().
use yansi::Paint;
painted.white();Source§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
Source§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
Source§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
Source§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
Source§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
Source§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
Source§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
Source§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
Source§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the background set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red() and
on_green(), which have the same functionality but
are pithier.
§Example
Set background color to red using fg():
use yansi::{Paint, Color};
painted.bg(Color::Red);Set background color to red using on_red().
use yansi::Paint;
painted.on_red();Source§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
Source§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
Source§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
Source§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
Source§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
Source§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
Source§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
Source§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
Source§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
Source§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
Source§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling Attribute value.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold() and
underline(), which have the same functionality
but are pithier.
§Example
Make text bold using attr():
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);Make text bold using using bold().
use yansi::Paint;
painted.bold();Source§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
Source§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi Quirk value.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask() and
wrap(), which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk():
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);Enable wrapping using wrap().
use yansi::Paint;
painted.wrap();Source§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
fn clear(&self) -> Painted<&T>
resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.Source§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the Condition value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted only when both stdout and stderr are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);