Home Reference Source
public class | source

Logger

You can directly use an instance of this class. logger

A class to mimic window.console

Constructor Summary

Public Constructor
public

Creates an instance of Logger

Method Summary

Public Methods
public

create(id: *): Logger

Create a new instance of the Logger

public

enabled(enabled: Boolean=false)

Enable or disable the console output

public

error()

Wrapper for console.error

public

info()

Wrapper for console.info

public

log()

Wrapper for console.log

public

setId(id: String)

Used to give an identifier to the output

public

warn()

Wrapper for console.warn

Public Constructors

public constructor(id: String) source

Creates an instance of Logger

Params:

NameTypeAttributeDescription
id String
  • optional

The identifier to appear before every output

Public Methods

public create(id: *): Logger source

Create a new instance of the Logger

Params:

NameTypeAttributeDescription
id *

Return:

Logger

The new Logger instance

public enabled(enabled: Boolean=false) source

Enable or disable the console output

Params:

NameTypeAttributeDescription
enabled Boolean=false
  • optional

Use true if you want the output to appear

public error() source

Wrapper for console.error

public info() source

Wrapper for console.info

public log() source

Wrapper for console.log

public setId(id: String) source

Used to give an identifier to the output

Params:

NameTypeAttributeDescription
id String

The identifier to appear before every output

public warn() source

Wrapper for console.warn