Debug Class
A static closure to provide easy access to the console without having errors if the console doesn't exist to use call: Debug.log('Your log here')
Item Index
Methods
Properties
- _isConnected static
- _isJSConsole static
- _messageObj static
- _messageQueue static
- _NET_PORT static
- _socket static
- DEBUG static
- enabled static
- ERROR static
- GENERAL static
- hasConsole
- INFO static
- minLogLevel static
- output static
- WARN static
Methods
assert
-
truth
-
params
Assert that something is true
Parameters:
-
truth
BoolAs statement that is assumed true
-
params
The message to error if the assert is false
clear
()
public
static
Method to clear the console
connect
-
The
Connect to the WebSocket
Parameters:
-
The
StringIP address to connect to
debug
-
params
Debug something in the console or remote
Parameters:
-
params
The statement or object to debug
dir
-
params
Method to describe an object in the console
Parameters:
-
params
ObjectThe object to describe in the console
disconnect
()
public
static
Disconnect from the WebSocket
error
-
params
Error something in the console or remote
Parameters:
-
params
The statement or object to error
globalErrorHandler
-
THe
-
The
-
The
Global window error handler
info
-
params
Info something in the console or remote
Parameters:
-
params
The statement or object to info
log
-
params
Log something in the console or remote
Parameters:
-
params
The statement or object to log
onClose
()
private
static
Callback for when the websocket is closed
onConnect
()
private
static
Callback when the WebSocket
is connected
output
-
level
-
args
Sent to the output
remoteLog
-
message
-
level
Send a remote log message using the socket connection
Parameters:
-
message
StringThe message to send
-
level
LevelThe log level to send
trace
-
params
Generate a stack track in the output
Parameters:
-
params
Optional parameters to log
warn
-
params
Warn something in the console or remote
Parameters:
-
params
The statement or object to warn
Properties
_isConnected
Bool
private
static
If the web socket is connected
Default: false
_isJSConsole
Bool
private
static
If the console is currently connected with JSConsole (jsconsole.com).
_NET_PORT
Int
private
static
Browser port for the websocket browsers tend to block ports
Default: 1025
_socket
WebSocket
private
static
The socket connection
DEBUG
Int
final
static
Log level for debug messages
enabled
Bool
public
static
Boolean to turn on or off the debugging
ERROR
Int
final
static
Log level for error messages
GENERAL
Int
final
static
The most general default debug level
hasConsole
Bool
private
If we have a console
INFO
Int
final
static
Log level for debug messages
minLogLevel
Int
public
static
The minimum log level to show, by default it's set to show all levels of logging.
output
JQuery
public
static
The jQuery element to output debug messages to
WARN
Int
final
static
Log level for warning messages