Skip to content

Commit

Permalink
remove log statement for legacy bazel watcher on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
joeljeske authored and achew22 committed Nov 27, 2023
1 parent 0937a85 commit 97249d3
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions internal/ibazel/fswatcher/factory_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,28 +19,17 @@ package fswatcher

import (
"os"
"sync"

"github.com/bazelbuild/bazel-watcher/internal/ibazel/fswatcher/common"
"github.com/bazelbuild/bazel-watcher/internal/ibazel/fswatcher/fsevents"
"github.com/bazelbuild/bazel-watcher/internal/ibazel/fswatcher/fsnotify"
"github.com/bazelbuild/bazel-watcher/internal/ibazel/log"
)

var experimentalWatcherLog sync.Once

func NewWatcher() (common.Watcher, error) {
flag, ok := os.LookupEnv("IBAZEL_USE_LEGACY_WATCHER")
if ok && flag != "0" {
return fsnotify.NewWatcher()
}

// Avoid logging if IBAZEL_USE_LEGACY_WATCHER=0
if !ok {
experimentalWatcherLog.Do(func() {
log.Log("You are using an experimental filesystem watcher. If you would like to disable that, please set the environment variable\n\tIBAZEL_USE_LEGACY_WATCHER=1")
})
}

return fsevents.NewWatcher()
}

0 comments on commit 97249d3

Please sign in to comment.