output

package
v0.0.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 3, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

output 包提供用户友好的终端输出函数。 所有函数同时输出到终端(带符号前缀)和日志文件。 交互式模式下仅写日志文件,不输出到终端。

与 logger 包的区别:

  • logger 包:调试日志,受 --verbose 控制,包含时间戳和级别标签
  • output 包:用户输出,始终显示,不包含时间戳和级别标签,使用符号前缀

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Errorf

func Errorf(format string, args ...interface{})

Errorf 输出错误消息(带 ✗ 前缀)。 用途:操作失败提示(如"✗ 下载已取消")。 非交互模式下输出到终端(红色),同时记录到日志文件。

func Infof

func Infof(format string, args ...interface{})

Infof 输出信息性消息。 无前缀,用途:操作进度、状态说明(如"正在查找文件"、"开始下载文件夹")。 非交互模式下输出到终端,同时记录到日志文件。

func SetInteractiveMode

func SetInteractiveMode(enabled bool)

SetInteractiveMode 设置交互式模式。 交互式模式下,output 函数不输出到终端,仅写日志文件。 用于 Bubble Tea TUI 模式,避免 fmt.Println 破坏 TUI 界面。

func Successf

func Successf(format string, args ...interface{})

Successf 输出成功消息(带 ✓ 前缀)。 用途:操作成功确认(如"✓ 文件下载完成")。 非交互模式下输出到终端(绿色),同时记录到日志文件。

func Warnf

func Warnf(format string, args ...interface{})

Warnf 输出警告消息(带 ⚠ 前缀)。 用途:可恢复警告(如"⚠ 登录过期,请重新登录")。 非交互模式下输出到终端(黄色),同时记录到日志文件。

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL