func log_output(str_content string) { fd,_:=os.OpenFile("a.txt",os.O_RDWR|os.O_CREATE|os.O_APPEND,0644) fd_time:=time.Now().Format("2006-01-02 15:04:05"); fd_content:=strings.Join([]string{"======",fd_time,"=====",str_content,"\n"},"") buf:=[]byte(fd_content) fd.Write(buf) fd.Close() }
golang调试日志写到txt
最新推荐文章于 2025-04-30 22:38:42 发布