Developer Tools
vwarnings
Warnings you can filter, show once, silence or make fatal.
Released v1.0.0 · 2026-09-28use "stdlib/warnings.ven"
A minimal warn and filter API, distinct from structured logging: a warning is a conditional signal about something that might be wrong, not an unconditional record of what happened, built on Venutian's own map, shape and print builtins. A warning can be filtered by category, so a program can quiet the ones it has already accounted for.
st = warnings_state()
print st.filters
:: prints: {}
Reference (5 functions)
API reference
warnings_state()
Builds a fresh WarningState with no filters set.
st = warnings_state()
print st.filters
:: prints: {}filterwarnings(state, action, category)
Sets the action for one category on state.
st = warnings_state()
filterwarnings(st, "once", "DeprecationWarning")
issue_warning(st, "low disk space", "DeprecationWarning")
issue_warning(st, "low disk space", "DeprecationWarning")
:: prints: DeprecationWarning: low disk spacesimplefilter(state, action)
Sets action as the action for every category at once on state.
st = warnings_state()
simplefilter(st, "ignore")
issue_warning(st, "noisy", "AnyCategory")
print "done"
:: prints: doneresetwarnings(state)
Clears every filter and "seen once" record on state.
st = warnings_state()
simplefilter(st, "ignore")
resetwarnings(st)
issue_warning(st, "back to default", "UserWarning")
:: prints: UserWarning: back to defaultissue_warning(state, message, category)
Issues a warning against state, honoring its filter for category.
st = warnings_state()
issue_warning(st, "deprecated argument 'x'", "DeprecationWarning")
:: prints: DeprecationWarning: deprecated argument 'x'