ShuiHu (Documentation Index
Fetch the complete documentation index at: https://mintlify.com/michael-tiger-2010/wyvernjs/llms.txt
Use this file to discover all available pages before exploring further.
sh) is WyvernJS’s logging and performance-timing module. It wraps console.log, console.warn, and console.error with timestamped, labeled log entries stored in an in-memory history, and provides a proxy-based step benchmarking system using Uint32Array for minimal overhead. Every log call records a { statement, context, label, timestamp } object internally, giving you a queryable history of everything your application has logged at runtime.
Log Levels
ShuiHu defines four severity levels. Each level maps to a numeric value used when filtering log output:| Level | Numeric value | Notes |
|---|---|---|
debug | 0 | General-purpose diagnostic output |
warn | 1 | Non-fatal conditions worth attention |
error | 2 | Recoverable failures |
dire | 3 | Critical failures — highest severity |
sh.log is a direct alias for sh.debug and behaves identically.
A
benchmark label also exists internally at level 0. It is used automatically by sh.time when a timer is stopped and cannot be called directly — there is no sh.benchmark() method. Because it shares level 0 with debug, benchmark reports are included whenever you filter at 'debug' (the default).Environment
ShuiHu requires ES9+. The core logging methods (log, debug, warn, error, dire, outputLogs, clear, setUpdateFn) and the sh.time benchmarking system work on any ES9+ JavaScript interpreter. The DOM helpers sh.createLogHolder() and sh.outputElementLogs() are browser-only and additionally depend on DiWu (dw.init()) for DOM manipulation.
Explore ShuiHu
Logging
Log methods, in-memory history, filtering with
outputLogs, live update callbacks, and DOM log output.Benchmarking
Proxy-based step timers with
sh.time, Uint32Array storage, and formatted benchmark reports.