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

Function NewJSONLogFile

pkg/userlog/json/jsonlogfile.go:43–53  ·  view source on GitHub ↗
(fpath string, cap int)

Source from the content-addressed store, hash-verified

41}
42
43func NewJSONLogFile(fpath string, cap int) (userlog.UserLogFile, error) {
44 f, err := os.OpenFile(fpath, os.O_WRONLY|os.O_APPEND|os.O_CREATE, 0644)
45 if err != nil {
46 return nil, err
47 }
48 w := &JSONLogFile{
49 writer: f,
50 capacity: int32(cap),
51 }
52 return w, nil
53}
54
55func (f *JSONLogFile) Write(l *userlog.UserLog, buf []byte) (int, error) {
56 w := f.writer

Callers 1

TestJSONLogFileFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestJSONLogFileFunction · 0.68