INNER CODE UNIT · Go

func

sy-vendor/Gobi · cmd/server/main.go:32

func (c *ConsoleAlertChannel) SendAlert(alert *errors.Alert) error {
	utils.Logger.WithFields(map[string]interface{}{
		"severity": alert.Severity,
		"type":     alert.Type,
		"message":  alert.Message,
		"details":  alert.Details,
	}).Error("ALERT")
	return nil
}

// setupServer 设置和配置服务器
func setupServer(cfg *config.Config) (*http.Server, error) {
	// 初始化错误监控
	errorMonitor := errors.GetGlobalMonitor()
	defer errorMonitor.Stop()

	// 添加控制台告警通道
	consoleAlertChannel := &ConsoleAlertChannel{}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…