我有一个应该是非常简单的记录器功能,但是在创建日志文件时,没有写入任何内容。我尝试了几种不同的方法,但它仍然失败。函数是funclogger(lognamestring,messagestring){logName:="../planner/log/"+logname+".log"varfile*os.Filefile,err:=os.OpenFile(logName,os.O_APPEND|os.O_CREATE,0755)iferr!=nil{fmt.Println("File",logName,"failedwitherror:",err)}//file.WriteString(