RapidContext
Access · Discovery · Insight
www.rapidcontext.com
Provides a logging service for debugging apps and server calls.
All log messages are filtered by log level and either discarded or
stored to an internal array. Log messages on the error or warning levels
are also sent to the server for remote logging.
This module replaces the built-in console.error(), console.warn(),
console.info(), console.log() and console.debug() functions with its
own versions, passing through the log messages if not filtered.
Source code:
RapidContext_Log.js
<static> |
RapidContext.Log.clear()
Clears the log console and the array of stored messages.
|
<static> |
RapidContext.Log.context(value)
Returns and optionally sets the current log context.
|
<static> |
RapidContext.Log.debug(msg)
Logs a debug message with optional data.
|
<static> |
RapidContext.Log.error(msg)
Logs an error message with optional data.
|
<static> |
RapidContext.Log.history()
Returns the history of filtered log entries.
|
<static> |
RapidContext.Log.info(msg)
Logs an information message with optional data.
|
<static> |
RapidContext.Log.init(opts)
Initializes and configures the logging module.
|
<static> |
RapidContext.Log.level(value)
Returns and optionally sets the current log level.
|
<static> |
RapidContext.Log.stringify(val)
Creates a string representation (suitable for logging) for any value or
object.
|
<static> |
RapidContext.Log.warn(msg)
Logs a warning message with optional data.
|
none,
error,
warn,
info,
logand
all.
RapidContext.Log.context('mybutton.onclick'); ... console.warn('unsupported xyz value:', value); ... RapidContext.Log.context(null);
console.error('failed to initialize module');
console.warn('missing "data" attribute on document root:', document.body);
console.info('authorization failed, user not logged in');
console.log('init AJAX call to URL:', url); ... console.log('done AJAX call to URL:', url, responseCode);