Reference Source Test
public class | source

Logger

You can directly use an instance of this class. logger

Constructor Summary

Public Constructor
public

constructor(level: String | null)

Default constructor

Member Summary

Public Members
public

classMap: {}

public

level: *

public

window: *

Method Summary

Public Methods
public

consoleLog(message: String, rest: Object)

Helpter function format the console.log message

public

debug(message: String, rest: Object)

Put a debug level message into the developer console, will only show up in debug level

public

error(message: String, stacktrace: Object, rest: Object)

Put an error level message into the developer console, will only show up if there is some level specified

public

getColors(className: String): {bgcolor: String, textcolor: String}

Given the name of the class this is for return the previously associated color or associate a random color to this class name

public

info(message: String, rest: Object)

Put a information level message into the developer console, will only show up in debug or info level

public

Figure out whether to return white or black text color for the given background colorMatch

public

padEnd(str: String, targetLength: Number, val: String): String

Pads the end of a string with the value if the String.prototype doesn't exist This is particularly for CircleCI which keeps failing :( and always uses the proptotype if it exists

public

Generate a random color within the acceptable 256 color range

Public Constructors

public constructor(level: String | null) source

Default constructor

Params:

NameTypeAttributeDescription
level String | null

debug|info|error

Public Members

public classMap: {} source

public level: * source

public window: * source

Public Methods

public consoleLog(message: String, rest: Object) source

Helpter function format the console.log message

Params:

NameTypeAttributeDescription
message String

the first variable passed to the console.log, generally a message formatted as ClassName - propertyFunction() - optional additional message

rest Object

an array of the rest of the variables passed to the console.log, typically class instances or variables in the file used for debugging

public debug(message: String, rest: Object) source

Put a debug level message into the developer console, will only show up in debug level

Params:

NameTypeAttributeDescription
message String

the first variable passed to the console.log, generally a message formatted as ClassName - propertyFunction() - optional additional message

rest Object

an array of the rest of the variables passed to the console.log, typically class instances or variables in the file used for debugging

public error(message: String, stacktrace: Object, rest: Object) source

Put an error level message into the developer console, will only show up if there is some level specified

Params:

NameTypeAttributeDescription
message String

the first variable passed to the console.log, generally a message formatted as ClassName - propertyFunction() - optional additional message

stacktrace Object

the error stack trace

rest Object

an array of the rest of the variables passed to the console.log, typically class instances or variables in the file used for debugging

public getColors(className: String): {bgcolor: String, textcolor: String} source

Given the name of the class this is for return the previously associated color or associate a random color to this class name

Params:

NameTypeAttributeDescription
className String

the name of the class this log message is for

Return:

{bgcolor: String, textcolor: String}

the background and text color for this class name

public info(message: String, rest: Object) source

Put a information level message into the developer console, will only show up in debug or info level

Params:

NameTypeAttributeDescription
message String

the first variable passed to the console.log, generally a message formatted as ClassName - propertyFunction() - optional additional message

rest Object

an array of the rest of the variables passed to the console.log, typically class instances or variables in the file used for debugging

public lightOrDark(color: String): String source

Figure out whether to return white or black text color for the given background colorMatch

Params:

NameTypeAttributeDescription
color String

the hexcode color without a # mark in front of it

Return:

String

#000 for light colors and #fff for dark colors

public padEnd(str: String, targetLength: Number, val: String): String source

Pads the end of a string with the value if the String.prototype doesn't exist This is particularly for CircleCI which keeps failing :( and always uses the proptotype if it exists

Params:

NameTypeAttributeDescription
str String

a string (will be cast to be sure)

targetLength Number

how long the final string should be

val String

what to pad the string with, defaults to space

Return:

String

returns the string at targetLength with val padded on the end

public randomColor(): String source

Generate a random color within the acceptable 256 color range

Return:

String

hexcode with a # prepended on it