MCPcopy
hub / github.com/containerd/containerd / LogFile

Function LogFile

pkg/cio/io.go:276–291  ·  view source on GitHub ↗

LogFile creates a file on disk that logs the task's STDOUT,STDERR. If the log file already exists, the logs will be appended to the file.

(path string)

Source from the content-addressed store, hash-verified

274// LogFile creates a file on disk that logs the task's STDOUT,STDERR.
275// If the log file already exists, the logs will be appended to the file.
276func LogFile(path string) Creator {
277 return func(_ string) (IO, error) {
278 uri, err := LogURIGenerator("file", path, nil)
279 if err != nil {
280 return nil, err
281 }
282
283 res := uri.String()
284 return &logURI{
285 config: Config{
286 Stdout: res,
287 Stderr: res,
288 },
289 }, nil
290 }
291}
292
293// LogURIGenerator is the helper to generate log uri with specific scheme.
294func LogURIGenerator(scheme string, path string, args map[string]string) (*url.URL, error) {

Callers 3

TestLogFileBackslashFunction · 0.85
TestLogFileAbsolutePathFunction · 0.85

Calls 2

LogURIGeneratorFunction · 0.85
StringMethod · 0.45

Tested by 3

TestLogFileBackslashFunction · 0.68
TestLogFileAbsolutePathFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…