func CreateErrorLogEntry(context *ctp.ApiContext, trigger *Trigger, errmsg string) *ctp.HttpError { var log = new(LogEntry) log.Id = ctp.NewBase64Id() log.Parent = trigger.Parent log.AccessTags = trigger.AccessTags log.CreationTime = ctp.Now() log.Trigger = trigger.Self log.Error = &errmsg log.Tags = []string{"error"} return log.Create(context) }
func CreateNormalLogEntry(context *ctp.ApiContext, trigger *Trigger, result *Result, tags []string) *ctp.HttpError { var log = new(LogEntry) log.Id = ctp.NewBase64Id() log.Parent = trigger.Parent log.AccessTags = trigger.AccessTags log.CreationTime = ctp.Now() log.Trigger = trigger.Self log.Result = result log.Tags = tags return log.Create(context) }