neu_draw.logs

Silencing the object-store logging that is noise. Opt-in, always.

TensorStore’s S3 stack logs at absl ERROR severity on paths that are not errors: it reports each credential provider it could not build before falling through to the one that works. So a perfectly successful read prints things like:

E0820 08:36:34 AuthCredentialsProvider:6146] static: Profile credentials provider
    could not load a profile at .
E0820 08:36:34 AuthCredentialsProvider:6146] Failed to resolve either region, role
    arn or token file path during sts web identity provider initialization.

These are not failures: a real problem says PERMISSION_DENIED or AccessDenied. No environment variable turns them off, and they are written by C++ straight to file descriptor 2, where contextlib.redirect_stderr cannot reach them. There are about two per store prefix, the first time it is opened.

Reads through sources are filtered by default (quiet_reads()). The filter drops only specific known lines, so anything unrecognised, or mentioning denied access, still prints. It applies for the duration of a read, not the session. Set neu_draw.logs.quiet = False to see everything. Nested and concurrent reads share one filter, so only one thread swaps fd 2.

Attributes

Functions

install_quiet_stores() → Callable[[], None]

Filter benign store logging for the whole session; returns an undo.

installed() → bool

Whether the filter is currently active in this process.

quiet_reads()

Filter benign store logging for one read; used by every sources entry point.

quiet_stores([enabled])

Drop benign store logging for the duration of the block.

remove_quiet_stores() → None

Restore unfiltered stderr. Safe to call when nothing is installed.

Module Contents

neu_draw.logs.install_quiet_stores() → Callable[[], None]

Filter benign store logging for the whole session; returns an undo.

For store access outside sources, such as a direct neu_vol call. Idempotent. It is per-process state, so a kernel restart clears it.

neu_draw.logs.installed() → bool

Whether the filter is currently active in this process.

neu_draw.logs.quiet_reads()

Filter benign store logging for one read; used by every sources entry point. With quiet false it filters nothing, neu-vol’s store opens included; a no-op when a session-wide filter is installed or an outer read is already filtering.

neu_draw.logs.quiet_stores(enabled: bool = True)

Drop benign store logging for the duration of the block.

>>> with quiet_stores():
...     skeletons = sources.body_skeletons(volume, bodies)
neu_draw.logs.remove_quiet_stores() → None

Restore unfiltered stderr. Safe to call when nothing is installed.

neu_draw.logs.quiet = True