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: boolForce plain text mode (no styling)
custom_colors: Option<CustomColors>Custom color overrides (theme accessed via crate::theme::theme())
Show startup banner
show_capabilities: boolShow capabilities list in banner
Banner display style
log_level: Option<Level>Log level filter
log_timestamps: boolShow timestamps in logs
log_targets: boolShow target module in logs
log_file_line: boolShow file and line in logs
show_stats_periodic: boolShow periodic stats
stats_interval_secs: u64Stats display interval in seconds
show_request_traffic: boolShow request/response traffic
traffic_verbosity: TrafficVerbosityTraffic logging verbosity
show_suggestions: boolShow fix suggestions for errors
show_error_codes: boolShow error codes
show_backtrace: boolShow backtraces for errors
max_table_rows: usizeMaximum rows in tables
max_json_depth: usizeMaximum depth for JSON display
truncate_at: usizeTruncate long strings at this length
Implementations§
Source§impl ConsoleConfig
impl ConsoleConfig
Sourcepub fn new() -> ConsoleConfig
pub fn new() -> ConsoleConfig
Create config with defaults
Sourcepub fn from_env() -> ConsoleConfig
pub fn from_env() -> ConsoleConfig
Create config from environment variables
§Environment Variables
| Variable | Values | Description |
|---|---|---|
FASTMCP_FORCE_COLOR | (set) | Force rich output |
FASTMCP_PLAIN | (set) | Force plain output |
NO_COLOR | (set) | Disable colors (standard) |
FASTMCP_BANNER | full/compact/minimal/none | Banner style |
FASTMCP_LOG | trace/debug/info/warn/error | Log level |
FASTMCP_LOG_TIMESTAMPS | 0/1 | Show timestamps |
FASTMCP_TRAFFIC | none/summary/headers/full | Traffic logging |
RUST_BACKTRACE | 1/full | Show backtraces |
Sourcepub fn force_color(self, force: bool) -> ConsoleConfig
pub fn force_color(self, force: bool) -> ConsoleConfig
Force color output
Sourcepub fn plain_mode(self) -> ConsoleConfig
pub fn plain_mode(self) -> ConsoleConfig
Enable plain text mode (no styling)
Set the banner style
Disable the banner entirely
Sourcepub fn with_log_level(self, level: Level) -> ConsoleConfig
pub fn with_log_level(self, level: Level) -> ConsoleConfig
Set the log level
Sourcepub fn with_traffic(self, verbosity: TrafficVerbosity) -> ConsoleConfig
pub fn with_traffic(self, verbosity: TrafficVerbosity) -> ConsoleConfig
Set traffic logging verbosity
Sourcepub fn with_periodic_stats(self, interval_secs: u64) -> ConsoleConfig
pub fn with_periodic_stats(self, interval_secs: u64) -> ConsoleConfig
Enable periodic stats display
Sourcepub fn without_suggestions(self) -> ConsoleConfig
pub fn without_suggestions(self) -> ConsoleConfig
Disable fix suggestions for errors
Sourcepub fn with_custom_colors(self, colors: CustomColors) -> ConsoleConfig
pub fn with_custom_colors(self, colors: CustomColors) -> ConsoleConfig
Set custom colors
Sourcepub fn with_context(self, context: DisplayContext) -> ConsoleConfig
pub fn with_context(self, context: DisplayContext) -> ConsoleConfig
Set display context explicitly
Sourcepub fn with_max_table_rows(self, max: usize) -> ConsoleConfig
pub fn with_max_table_rows(self, max: usize) -> ConsoleConfig
Set maximum table rows
Sourcepub fn with_max_json_depth(self, max: usize) -> ConsoleConfig
pub fn with_max_json_depth(self, max: usize) -> ConsoleConfig
Set maximum JSON depth
Sourcepub fn with_truncate_at(self, len: usize) -> ConsoleConfig
pub fn with_truncate_at(self, len: usize) -> ConsoleConfig
Set truncation length
Sourcepub fn theme(&self) -> &'static FastMcpTheme
pub fn theme(&self) -> &'static FastMcpTheme
Get the theme (uses global theme singleton)
Sourcepub fn resolve_context(&self) -> DisplayContext
pub fn resolve_context(&self) -> DisplayContext
Resolve the display context based on config and environment
Sourcepub fn should_use_rich(&self) -> bool
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
impl Clone for ConsoleConfig
Source§fn clone(&self) -> ConsoleConfig
fn clone(&self) -> ConsoleConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more