Status Messages
setStatus
Display a transient message in the editor’s status bar.string
required
Text to display (keep short - status bar has limited width)
The message will be shown until the next status update or user action. Use for feedback on completed operations (e.g., “File saved”, “2 matches found”).
Logging Functions
Fresh provides four log levels for plugin messages. Messages appear in the log file when running with appropriateRUST_LOG environment variable settings.
debug
Log a debug message from a plugin.string
required
Debug message - include context like function name and relevant values
Messages appear in log file when running with
RUST_LOG=debug. Useful for plugin development and troubleshooting.info
Log an info message from a plugin.string
required
Info message
Messages appear in log file when running with
RUST_LOG=info. Use for important operational messages.warn
Log a warning message from a plugin.string
required
Warning message
Messages appear in log file when running with
RUST_LOG=warn. Use for warnings that don’t prevent operation but indicate issues.error
Log an error message from a plugin.string
required
Error message
Messages appear in log file when running with
RUST_LOG=error. Use for critical errors that need attention.Log Levels
Control which messages appear in the log by setting theRUST_LOG environment variable:
Best Practices
Use appropriate log levels
Use appropriate log levels
debug(): Development info, variable values, function entry/exitinfo(): Important milestones, configuration loaded, plugin initializedwarn(): Recoverable issues, missing config, deprecated featureserror(): Critical failures, exceptions, data corruption
Include context in messages
Include context in messages
Make log messages self-explanatory by including relevant context:
Use setStatus for user feedback
Use setStatus for user feedback
Status messages are for users, log messages are for developers:
Keep status messages concise
Keep status messages concise
The status bar has limited width. Keep messages short and clear: