# console

console 全局的实现。

¥An implementation of the console global.

# 静态成员

¥Static members

  • function assert<T>(assertion: T, message?: string): void
    

    如果 assertion 为 false,则将 message 记录到控制台。

    ¥Logs message to console if assertion is false-ish.

  • function log(message?: string): void
    

    message 输出到控制台。

    ¥Outputs message to the console.

  • function debug(message?: string): void
    function info(message?: string): void
    function warn(message?: string): void
    function error(message?: string): void
    

    message 输出到控制台,分别以 "调试:"、"信息:"、"警告:" 或 "错误:" 为前缀。

    ¥Outputs message to the console, prefixed with "Debug:", "Info:", "Warning:" or "Error:" respectively.

  • function time(label?: string): void
    

    使用指定的 label 启动新计时器。

    ¥Starts a new timer using the specified label.

  • function timeLog(label?: string): void
    

    记录先前使用 console.time 启动的计时器的当前值。

    ¥Logs the current value of a timer previously started with console.time.

  • function timeEnd(label?: string): void
    

    记录先前以 console.time 启动的计时器的当前值并丢弃该计时器。

    ¥Logs the current value of a timer previously started with console.time and discards the timer.