Log.LogFull(senderName,LM.CategorySYSTEM,LM.LevelERROR,LM.SeverityCritical,LM.ImpactCritical,LM.MessageNameDATABASE,`Was not able to open the templates out of the GridFS!`,errGridFile.Error())
Log.LogShort(senderName,LM.CategorySYSTEM,LM.LevelINFO,LM.MessageNameCONFIGURATION,`Read the templates.zip file from the grid file system.`,`Upload time UTC: `+Tools.FormatTime(gridFile.UploadDate().UTC()))
Log.LogFull(senderName,LM.CategorySYSTEM,LM.LevelERROR,LM.SeverityCritical,LM.ImpactCritical,LM.MessageNameDATABASE,`Was not able to read the templates.`,ioError.Error())
Log.LogFull(senderName,LM.CategorySYSTEM,LM.LevelERROR,LM.SeverityCritical,LM.ImpactCritical,LM.MessageNameREAD,`Was not able to read the ZIP file.`,readerError.Error())
return
}
templates=template.New(`root`)
for_,file:=rangereader.File{
fileReader,openError:=file.Open()
ifopenError==nil{
contentData,readError:=ioutil.ReadAll(fileReader)
fileReader.Close()
ifreadError!=nil{
Log.LogFull(senderName,LM.CategorySYSTEM,LM.LevelERROR,LM.SeverityCritical,LM.ImpactCritical,LM.MessageNameREAD,`Was not able to read the content of the desired template.`,readError.Error(),file.FileInfo().Name())
continue
}
templateData:=string(contentData)
templates.Parse(templateData)
Log.LogShort(senderName,LM.CategorySYSTEM,LM.LevelINFO,LM.MessageNameEXECUTE,fmt.Sprintf(`The template '%s' was parsed.`,file.FileInfo().Name()))
}else{
Log.LogFull(senderName,LM.CategorySYSTEM,LM.LevelERROR,LM.SeverityCritical,LM.ImpactCritical,LM.MessageNameDATABASE,`Was not able to open a template.`,file.FileInfo().Name())