MCPcopy Create free account
hub / github.com/containerd/nerdctl / NewLogFileWatcher

Function NewLogFileWatcher

pkg/logging/logging.go:432–442  ·  view source on GitHub ↗
(dir string)

Source from the content-addressed store, hash-verified

430}
431
432func NewLogFileWatcher(dir string) (*fsnotify.Watcher, error) {
433 watcher, err := fsnotify.NewWatcher()
434 if err != nil {
435 return nil, fmt.Errorf("failed to create fsnotify watcher: %v", err)
436 }
437 if err = watcher.Add(dir); err != nil {
438 watcher.Close()
439 return nil, fmt.Errorf("failed to watch directory %q: %w", dir, err)
440 }
441 return watcher, nil
442}
443
444// startTail wait for the next log write.
445// the boolean value indicates if the log file was recreated;

Callers 2

ReadLogsFunction · 0.85
viewLogsJSONFileDirectFunction · 0.85

Calls 2

AddMethod · 0.80
CloseMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…