Skip to main content

ConsoleConfig

Struct ConsoleConfig 

Source
pub struct ConsoleConfig {
Show 21 fields pub context: Option<DisplayContext>, pub force_color: Option<bool>, pub force_plain: bool, pub custom_colors: Option<CustomColors>, pub show_banner: bool, pub show_capabilities: bool, pub banner_style: BannerStyle, pub log_level: Option<Level>, pub log_timestamps: bool, pub log_targets: bool, pub log_file_line: bool, pub show_stats_periodic: bool, pub stats_interval_secs: u64, pub show_request_traffic: bool, pub traffic_verbosity: TrafficVerbosity, pub show_suggestions: bool, pub show_error_codes: bool, pub show_backtrace: bool, pub max_table_rows: usize, pub max_json_depth: usize, pub truncate_at: usize,
}
Expand description

Comprehensive configuration for FastMCP console output

Fields§

§context: Option<DisplayContext>

Override display context (None = auto-detect)

§force_color: Option<bool>

Force color output even in non-TTY

§force_plain: bool

Force plain text mode (no styling)

§custom_colors: Option<CustomColors>

Custom color overrides (theme accessed via crate::theme::theme())

§show_banner: bool

Show startup banner

§show_capabilities: bool

Show capabilities list in banner

§banner_style: BannerStyle

Banner display style

§log_level: Option<Level>

Log level filter

§log_timestamps: bool

Show timestamps in logs

§log_targets: bool

Show target module in logs

§log_file_line: bool

Show file and line in logs

§show_stats_periodic: bool

Show periodic stats

§stats_interval_secs: u64

Stats display interval in seconds

§show_request_traffic: bool

Show request/response traffic

§traffic_verbosity: TrafficVerbosity

Traffic logging verbosity

§show_suggestions: bool

Show fix suggestions for errors

§show_error_codes: bool

Show error codes

§show_backtrace: bool

Show backtraces for errors

§max_table_rows: usize

Maximum rows in tables

§max_json_depth: usize

Maximum depth for JSON display

§truncate_at: usize

Truncate long strings at this length

Implementations§

Source§

impl ConsoleConfig

Source

pub fn new() -> ConsoleConfig

Create config with defaults

Source

pub fn from_env() -> ConsoleConfig

Create config from environment variables

§Environment Variables
VariableValuesDescription
FASTMCP_FORCE_COLOR(set)Force rich output
FASTMCP_PLAIN(set)Force plain output
NO_COLOR(set)Disable colors (standard)
FASTMCP_BANNERfull/compact/minimal/noneBanner style
FASTMCP_LOGtrace/debug/info/warn/errorLog level
FASTMCP_LOG_TIMESTAMPS0/1Show timestamps
FASTMCP_TRAFFICnone/summary/headers/fullTraffic logging
RUST_BACKTRACE1/fullShow backtraces
Source

pub fn force_color(self, force: bool) -> ConsoleConfig

Force color output

Source

pub fn plain_mode(self) -> ConsoleConfig

Enable plain text mode (no styling)

Source

pub fn with_banner(self, style: BannerStyle) -> ConsoleConfig

Set the banner style

Source

pub fn without_banner(self) -> ConsoleConfig

Disable the banner entirely

Source

pub fn with_log_level(self, level: Level) -> ConsoleConfig

Set the log level

Source

pub fn with_traffic(self, verbosity: TrafficVerbosity) -> ConsoleConfig

Set traffic logging verbosity

Source

pub fn with_periodic_stats(self, interval_secs: u64) -> ConsoleConfig

Enable periodic stats display

Source

pub fn without_suggestions(self) -> ConsoleConfig

Disable fix suggestions for errors

Source

pub fn with_custom_colors(self, colors: CustomColors) -> ConsoleConfig

Set custom colors

Source

pub fn with_context(self, context: DisplayContext) -> ConsoleConfig

Set display context explicitly

Source

pub fn with_max_table_rows(self, max: usize) -> ConsoleConfig

Set maximum table rows

Source

pub fn with_max_json_depth(self, max: usize) -> ConsoleConfig

Set maximum JSON depth

Source

pub fn with_truncate_at(self, len: usize) -> ConsoleConfig

Set truncation length

Source

pub fn theme(&self) -> &'static FastMcpTheme

Get the theme (uses global theme singleton)

Source

pub fn resolve_context(&self) -> DisplayContext

Resolve the display context based on config and environment

Source

pub fn should_use_rich(&self) -> bool

Check if rich output should be used based on resolved context

Trait Implementations§

Source§

impl Clone for ConsoleConfig

Source§

fn clone(&self) -> ConsoleConfig

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ConsoleConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Default for ConsoleConfig

Source§

fn default() -> ConsoleConfig

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, _span: NoopSpan) -> Self

Instruments this future with a span (no-op when disabled).
Source§

fn in_current_span(self) -> Self

Instruments this future with the current span (no-op when disabled).
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more