MCPcopy Create free account
hub / github.com/baidu/EasyFaaS / WriteFunctionLog

Method WriteFunctionLog

pkg/controller/rtctrl/logstore.go:258–285  ·  view source on GitHub ↗
(log string)

Source from the content-addressed store, hash-verified

256}
257
258func (s *kunLogStatStore) WriteFunctionLog(log string) error {
259 if s.flags.Has(flagClosed) {
260 return errReceiverClosed
261 }
262 s.appendLogbuf([]byte(log), true)
263 logfile := s.logfile
264 if logfile == nil {
265 return nil
266 }
267 l := &userlog.UserLog{
268 Created: time.Now(),
269 TriggerType: s.triggerType,
270 RuntimeID: s.runtimeID,
271 RequestID: s.requestID,
272 Source: logSource[easyfaasSysLog],
273 Message: []byte(log),
274 UserID: s.userID,
275 FuncName: s.funcName,
276 FunctionBrn: s.funcBrn,
277 Version: s.funcVersion,
278 InvocationTime: -1,
279 MemoryUsage: -1,
280 ResponseStatus: -1,
281 Mode: "",
282 }
283 _, err := logfile.Write(l, []byte(log))
284 return err
285}
286
287type reportParameters struct {
288 InvocationTime int64

Callers

nothing calls this directly

Calls 3

appendLogbufMethod · 0.95
WriteMethod · 0.65
HasMethod · 0.45

Tested by

no test coverage detected