Skip to content

Commit

Permalink
chore: Make some log messages more useful for debugging.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaqx0r committed May 25, 2024
1 parent 76abfd9 commit 01db877
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions internal/tailer/tail.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,11 +220,12 @@ func (t *Tailer) AddPattern(pattern string) error {
path := pattern
switch u.Scheme {
default:
glog.V(2).Infof("%v: %q in path pattern %q, treating as path", ErrUnsupportedURLScheme, u.Scheme, pattern)
glog.V(2).Infof("AddPattern(%v): %v in path pattern %q, treating as path", pattern, ErrUnsupportedURLScheme, u.Scheme)
// Leave path alone per log message
case "unix", "unixgram", "tcp", "udp":
// Keep the scheme.
glog.V(2).Infof("AddPattern: socket %q", pattern)
t.socketPaths = append(t.socketPaths, pattern)
glog.V(2).Infof("AddPattern(%v): is a socket", path)
t.socketPaths = append(t.socketPaths, path)
return nil
case "", "file":
// Leave path alone; may contain globs
Expand All @@ -236,11 +237,11 @@ func (t *Tailer) AddPattern(pattern string) error {
} else {
path, err = filepath.Abs(path)
if err != nil {
glog.V(2).Infof("Couldn't canonicalize path %q: %s", u.Path, err)
glog.V(2).Infof("AddPattern(%v): couldn't canonicalize path: %v", path, err)
return err
}
}
glog.V(2).Infof("AddPattern: file %q", path)
glog.V(2).Infof("AddPattern(%v): is a file-like pattern", path)
t.globPatternsMu.Lock()
t.globPatterns[path] = struct{}{}
t.globPatternsMu.Unlock()
Expand Down

0 comments on commit 01db877

Please sign in to comment.