func CreateFilePath(dir string, f *File) string { os.MkdirAll(dir, os.ModePerm) name := utils.DateInt64(utils.Now(), "YYYYMMDDHHmmss") name += strconv.Itoa(Storage.TimeInc(10)) + path.Ext(f.Name) return path.Join(dir, name) }
// LogErrors logs error bytes to tmp/log directory. func LogError(bytes []byte) { dir := App.Config().String("app.log_dir") file := path.Join(dir, utils.DateInt64(utils.Now(), "MMDDHHmmss.log")) ioutil.WriteFile(file, bytes, os.ModePerm) }