Namespace: log

log

向 Web 控制台输出一条消息,可以通过设置等级过滤输出的消息。

Example

Hilo3d.log.level = Hilo3d.log.LEVEL_LOG | Hilo3d.log.LEVEL_ERROR;
Hilo3d.log.error("ERROR!");

Members Show Inherited

staticlog.levelNumber

log级别

Default Value:
  • LEVEL_LOG | LEVEL_WARN | LEVEL_ERROR

static,readonlylog.LEVEL_NONENumber

不显示任何

Default Value:
  • 0

static,readonlylog.LEVEL_LOGNumber

显示 log

Default Value:
  • 1

static,readonlylog.LEVEL_WARNNumber

显示 warn

Default Value:
  • 2

static,readonlylog.LEVEL_ERRORNumber

显示 error

Default Value:
  • 4

Methods Show Inherited

staticlog.log(params){log}

log,等同 console.log

Name Type Description
params any repeatable
Returns:
Type Description
log this
Example
Hilo3d.log.log('a', {a:1});

staticlog.warn(params){log}

warn,等同 console.warn

Name Type Description
params any repeatable
Returns:
Type Description
log this
Example
Hilo3d.log.warn('a', {a:1});

staticlog.error(params){log}

error,等同 console.error

Name Type Description
params any repeatable
Returns:
Type Description
log this
Example
Hilo3d.log.error('a', {a:1});

staticlog.logOnce(id, params){log}

logOnce 相同 id 只 log 一次

Name Type Description
id string
params any repeatable
Returns:
Type Description
log this
Example
Hilo3d.log.logOnce('uniqueId0', 'a', {a:1});

staticlog.warnOnce(id, params){log}

warnOnce 相同 id 只 once 一次

Name Type Description
id string
params any repeatable
Returns:
Type Description
log this
Example
Hilo3d.log.warnOnce('uniqueId0', 'a', {a:1});

staticlog.errorOnce(id, params){log}

errorOnce 相同 id 只 error 一次

Name Type Description
id string
params any repeatable
Returns:
Type Description
log this
Example
Hilo3d.log.errorOnce('uniqueId0', 'a', {a:1});