new logger(initial_context)
BBOP JS logger object. Using .kvetch(), you can automatically log a
message in almost any environment you find yourself in--browser,
server wherever. Also, if you have jQuery available and an element
with the id "bbop-logger-console-textarea",
"bbop-logger-console-text", or "bbop-logger-console-html", the
logger will append to that element (with a "\n" (autoscroll), "\n",
or "
" terminator respectively) instead.
" terminator respectively) instead.
Parameters:
Name | Type | Description |
---|---|---|
initial_context |
string | (optional) initial context as string. |
Members
-
DEBUG
-
Different debugging available per object. Externally toggle between true and false to switch on and off the logging.
Methods
-
kvetch(initial_context) → {string}
-
Log a string to somewhere. Also return a string to (mostly for the unit tests).
Parameters:
Name Type Description initial_context
string (optional) initial context as string Returns:
string to print out to wherever we found- Type
- string
-
pop_context()
-
Remove the last context if it's there.
-
push_context(new_context)
-
Add an additional logging context to the stack.
Parameters:
Name Type Description new_context
string New context to add to the context stack. -
reset_context(new_initial_context)
-
Define the ability to reset the contex.
Parameters:
Name Type Description new_initial_context
string (optional) new context to start with