neu_vol.logs

Drop the object-store logging that is noise, and only that.

TensorStore’s S3 stack logs at absl ERROR severity on every successful store open: the credential providers that could not be built before the one that works. No environment variable turns this off, and it comes from C++ on fd 2, so quiet_store_logs() filters fd 2 through a pipe. Two rules keep it from hiding real problems:

  1. It is a deny-list of known-noise strings, not a severity filter: an unrecognized message always passes through.

  2. NEVER_DROP wins over every pattern, so denied access, HTTP error codes and tensorstore failure statuses are always printed.

The lines are written while a store OPENS, so neu-vol’s two open paths (location._open_store and the tensorstore backend’s _ts_open) filter themselves with quiet_reads(), and every caller is covered — CLI, notebook or script — with nothing to invoke. quiet_store_logs() still wraps the CLIs, for anything else on fd 2; quiet_store_logs(False) turns all of it off.

Attributes

Functions

is_benign(line) → bool

True if this line is known store-stack noise and safe to drop.

quiet_reads()

Filter benign store logging for one read, safe to nest and to call from threads.

quiet_store_logs([enabled])

Filter benign object-store logging out of fd 2 for the duration.

Module Contents

neu_vol.logs.is_benign(line: bytes) → bool

True if this line is known store-stack noise and safe to drop.

neu_vol.logs.quiet_reads()

Filter benign store logging for one read, safe to nest and to call from threads.

For a library function a notebook calls directly:

with quiet_reads():
    info = location.read_json(source, "info")

A no-op when reads_quiet is false or an outer read is already filtering. Only the outermost caller swaps fd 2, since racing dup2 calls could lose output.

neu_vol.logs.quiet_store_logs(enabled: bool = True)

Filter benign object-store logging out of fd 2 for the duration.

With enabled false nothing is filtered, including the store opens that filter themselves (reads_quiet is off for the duration), which is what a --store-logs flag means. Also passes everything when fd 2 cannot be duplicated (a closed or exotic stderr), which is the safe direction.

neu_vol.logs.BENIGN_PATTERNS = ('Profile credentials provider could not load a profile', 'Failed to resolve either region, role...
neu_vol.logs.NEVER_DROP = ('PERMISSION_DENIED', 'AccessDenied', 'Access Denied', 'UNAUTHENTICATED', 'NOT_FOUND',...
neu_vol.logs.reads_quiet = True