ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
[TOC] ## syslog.Dial ``` sysLog, err := syslog.Dial("", "", syslog.LOG_ERR, "go program") if err != nil { log.Fatal(err) } defer sysLog.Close() sysLog.Emerg("Hello world!") // Dec 27 14:23:20 mbp go program[26840]: Hello world! sysLog.Info("hello info") sysLog.Crit("hello Crit") // Dec 27 14:26:46 mbp go program[27251]: hello Crit sysLog.Alert("hello Alert") sysLog.Debug("hello debuig") ``` 把日志写入系统的 `/var/log/system.log`