pub struct Console;Expand description
A console abstraction providing web console API methods.
Methods are associated functions (not instance methods) that internally
access the global Console signal, so callers use Console::log(msg)
without needing to obtain or hold a Console instance.
Implementations§
Source§impl Console
Implements the Console struct providing web console API methods.
impl Console
Implements the Console struct providing web console API methods.
Each method outputs to both the browser developer console and the vConsole panel signal, with appropriate log level classification. Methods are associated functions that internally access the global Console instance, so callers never need to hold a reference.
Sourcepub fn init()
pub fn init()
Initializes the global Console log signal.
Must be called once during application startup before any Console::log,
Console::warn, or Console::error calls.
Sourcepub fn log<M>(message: M)
pub fn log<M>(message: M)
Logs an informational message (equivalent to console.log).
The vConsole panel entry is appended only when Console::init has
been called; the browser console output always happens.
§Arguments
M: AsRef<str>- The message to log.
Sourcepub fn warn<M>(message: M)
pub fn warn<M>(message: M)
Logs a warning message (equivalent to console.warn).
The vConsole panel entry is appended only when Console::init has
been called; the browser console output always happens.
§Arguments
M: AsRef<str>- The warning message to log.