(log string, params *reportParameters)
| 292 | } |
| 293 | |
| 294 | func (s *kunLogStatStore) WriteFunctionReportLog(log string, params *reportParameters) error { |
| 295 | if s.flags.Has(flagClosed) { |
| 296 | return errReceiverClosed |
| 297 | } |
| 298 | s.appendLogbuf([]byte(log), true) |
| 299 | logfile := s.logfile |
| 300 | if logfile == nil { |
| 301 | return nil |
| 302 | } |
| 303 | l := &userlog.UserLog{ |
| 304 | Created: time.Now(), |
| 305 | TriggerType: s.triggerType, |
| 306 | RuntimeID: s.runtimeID, |
| 307 | RequestID: s.requestID, |
| 308 | Source: logSource[easyfaasSysLog], |
| 309 | Message: []byte(log), |
| 310 | UserID: s.userID, |
| 311 | FuncName: s.funcName, |
| 312 | FunctionBrn: s.funcBrn, |
| 313 | Version: s.funcVersion, |
| 314 | InvocationTime: params.InvocationTime, |
| 315 | MemoryUsage: params.MemUsage, |
| 316 | Mode: params.Mode, |
| 317 | ResponseStatus: params.Status, |
| 318 | } |
| 319 | _, err := logfile.Write(l, []byte(log)) |
| 320 | return err |
| 321 | } |
| 322 | |
| 323 | func (s *kunLogStatStore) SetMemUsed(used int64) { |
| 324 | if s.maxMem < used { |
nothing calls this directly
no test coverage detected