springroll.Debug Class

Defined in: springroll.Debug:11
Module: Debug

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')

Methods

_colorClosure

(
  • hex
)
Function
private

Defined in _colorClosure:1138

Due to the way closures and variables work, _colorClosure returns the color logging function needed for the color that you pass it.

Parameters:

  • hex String

    Hex value to apply to CSS color

Returns:

_remoteLog

(
  • message
  • [level=0]
  • [stack]
)
Debug
private static

Defined in _remoteLog:379

Send a remote log message using the socket connection

Parameters:

  • message Array

    The message to send

  • [level=0] Level optional

    The log level to send

  • [stack] String optional

    A stack to use for the message. A stack will be created if stack is omitted.

Returns:

Debug:

The instance of debug for chaining

aqua

(
  • message
)
Debug
static

Defined in aqua:1010

Output a general log colored as aqua

Parameters:

  • message

    The message to log

Returns:

Debug:

The instance of debug for chaining

assert

(
  • truth
  • params
)
Debug
public static

Defined in assert:800

Assert that something is true

Parameters:

  • truth Boolean

    As statement that is assumed true

  • params

    The message to error if the assert is false

Returns:

Debug:

The instance of debug for chaining

blue

(
  • message
)
Debug
static

Defined in blue:1001

Output a general log colored as blue

Parameters:

  • message

    The message to log

Returns:

Debug:

The instance of debug for chaining

clear

() Debug
public static

Defined in clear:855

Method to clear the console

Returns:

Debug:

The instance of debug for chaining

connect

(
  • host
)
Boolean
public static

Defined in connect:250

Connect to the WebSocket

Parameters:

  • host String

    The remote address to connect to, IP address or host name

Returns:

Boolean:

If a connection was attempted

debug

(
  • params
)
Debug
public static

Defined in debug:670

Debug something in the console or remote

Parameters:

  • params

    The statement or object to debug

Returns:

Debug:

The instance of debug for chaining

dir

(
  • params
)
Debug
public static

Defined in dir:828

Method to describe an object in the console

Parameters:

  • params Object

    The object to describe in the console

Returns:

Debug:

The instance of debug for chaining

disconnect

()
public static

Defined in disconnect:281

Disconnect from the WebSocket

domOutput

(
  • level
  • args
)
private static

Defined in domOutput:363

Sent to the output

Parameters:

  • level String

    The log level

  • args String

    Additional arguments

error

(
  • params
)
public static

Defined in error:771

Error something in the console or remote

Parameters:

  • params

    The statement or object to error

globalErrorHandler

(
  • message
  • file
  • line
  • column
  • error
)
private static

Global window error handler, used for remote connections.

Parameters:

  • message String

    The error message

  • file String

    The url of the file

  • line Int

    The line within the file

  • column Int

    The column within the line

  • error Error

    The error itself

gray

(
  • message
)
Debug
static

Defined in gray:1117

Output a general log colored as gray

Parameters:

  • message

    The message to log

Returns:

Debug:

The instance of debug for chaining

green

(
  • message
)
Debug
static

Defined in green:1036

Output a general log colored as green

Parameters:

  • message

    The message to log

Returns:

Debug:

The instance of debug for chaining

group

(
  • params
)
Debug
public static

Defined in group:909

Starts a new logging group with an optional title. All console output that occurs after calling this method and calling Debug.groupEnd() appears in the same visual group.

Parameters:

  • params

    Optional parameters to log

Returns:

Debug:

The instance of debug for chaining

groupCollapsed

(
  • params
)
Debug
public static

Defined in groupCollapsed:933

Creates a new logging group that is initially collapsed instead of open, as with Debug.group().

Parameters:

  • params

    Optional parameters to log

Returns:

Debug:

The instance of debug for chaining

groupEnd

() Debug
public static

Defined in groupEnd:956

Starts a new logging group with an optional title. All console output that occurs after calling this method and calling console.groupEnd() appears in the same visual group.

Returns:

Debug:

The instance of debug for chaining

info

(
  • params
)
Debug
public static

Defined in info:711

Info something in the console or remote

Parameters:

  • params

    The statement or object to info

Returns:

Debug:

The instance of debug for chaining

lime

(
  • message
)
Debug
static

Defined in lime:1045

Output a general log colored as lime

Parameters:

  • message

    The message to log

Returns:

Debug:

The instance of debug for chaining

log

(
  • params
)
Debug
public static

Defined in log:640

Log something in the console or remote

Parameters:

  • params

    The statement or object to log

Returns:

Debug:

The instance of debug for chaining

maroon

(
  • message
)
Debug
static

Defined in maroon:1099

Output a general log colored as maroon

Parameters:

  • message

    The message to log

Returns:

Debug:

The instance of debug for chaining

navy

(
  • message
)
Debug
static

Defined in navy:992

Output a general log colored as navy

Parameters:

  • message

    The message to log

Returns:

Debug:

The instance of debug for chaining

olive

(
  • message
)
Debug

Defined in olive:1028

Output a general log colored as olive

Parameters:

  • message

    The message to log

Returns:

Debug:

The instance of debug for chaining

onClose

()
private static

Defined in onClose:344

Callback for when the websocket is closed

onConnect

()
private static

Defined in onConnect:296

Callback when the WebSocket is connected

orange

(
  • message
)
Debug
static

Defined in orange:1063

Output a general log colored as orange

Parameters:

  • message

    The message to log

Returns:

Debug:

The instance of debug for chaining

pink

(
  • message
)
Debug
static

Defined in pink:1081

Output a general log colored as pink

Parameters:

  • message

    The message to log

Returns:

Debug:

The instance of debug for chaining

purple

(
  • message
)
Debug
static

Defined in purple:1090

Output a general log colored as purple

Parameters:

  • message

    The message to log

Returns:

Debug:

The instance of debug for chaining

red

(
  • message
)
Debug
static

Defined in red:1072

Output a general log colored as red

Parameters:

  • message

    The message to log

Returns:

Debug:

The instance of debug for chaining

removeCircular

(
  • obj
)
private

Defined in removeCircular:557

Strip out known circular references

Parameters:

  • obj Object

    The object to remove references from

silver

(
  • message
)
Debug
static

Defined in silver:1108

Output a general log colored as silver

Parameters:

  • message

    The message to log

Returns:

Debug:

The instance of debug for chaining

teal

(
  • message
)
Debug
static

Defined in teal:1019

Output a general log colored as teal

Parameters:

  • message

    The message to log

Returns:

Debug:

The instance of debug for chaining

trace

(
  • params
)
Debug
public static

Defined in trace:882

Generate a stack track in the output

Parameters:

  • params

    Optional parameters to log

Returns:

Debug:

The instance of debug for chaining

warn

(
  • params
)
Debug
public static

Defined in warn:741

Warn something in the console or remote

Parameters:

  • params

    The statement or object to warn

Returns:

Debug:

The instance of debug for chaining

yellow

(
  • message
)
Debug
static

Defined in yellow:1054

Output a general log colored as yellow

Parameters:

  • message

    The message to log

Returns:

Debug:

The instance of debug for chaining

_consoleSupportsColors

Boolean private

If the console supports coloring

_hasConsole

Boolean private

Defined in _hasConsole:21

If we have a console

_palette

Object private

Defined in _palette:979

List of hex colors to create Debug shortcuts for. Each key will become a function Debugkey that outputs the message in the specified color to the console if the browsers allows colored logging. Color Palette pulled from "Better CSS Defaults" (https://github.com/mrmrs/colors)

_socket

WebSocket private static

Defined in _socket:170

The socket connection

_socketMessage

Object private static

Defined in _socketMessage:178

The current message object being sent to the WebSocket

_socketQueue

Array private static

Defined in _socketQueue:186

The WebSocket message queue

_useSocket

Boolean private static

Defined in _useSocket:161

If the WebSocket is connected

Default: false

circularArray

Array private static

Defined in circularArray:549

An array for preventing circular references

enabled

Boolean public static

Defined in enabled:135

Boolean to turn on or off the debugging

Levels

springroll.Enum static

Defined in Levels:83

The levels of logging

Levels.DEBUG

Int static

Defined in Levels.DEBUG:104

The info log level, more priority than DEBUG

Levels.DEBUG

Int static

Defined in Levels.DEBUG:97

The debug log level, more priority than GENERAL

Levels.ERROR

Int static

Defined in Levels.ERROR:118

The error log level, the most priority log level

Levels.GENERAL

Int static

Defined in Levels.GENERAL:90

The most basic general log level

Levels.WARN

Int static

Defined in Levels.WARN:111

The warn log level, more priority than WARN

lineLocationFinder

RegEx private static

Regular expression to get the line number and column from a stack trace line.

methodsToStrip

Array private static

Defined in methodsToStrip:201

Methods names to use to strip out lines from stack traces in remote logging.

minLogLevel

Int public static

Defined in minLogLevel:126

The minimum log level to show, by default it's set to show all levels of logging.

NET_PORT

Int private static

Defined in NET_PORT:152

Browser port for the websocket - browsers tend to block lower ports

Default: 1026

output

DOMElement public static

Defined in output:143

The DOM element to output debug messages to