Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

console #56

Open
Genluo opened this issue Sep 6, 2019 · 1 comment
Open

console #56

Genluo opened this issue Sep 6, 2019 · 1 comment
Labels
Node Node相关

Comments

@Genluo
Copy link
Owner

Genluo commented Sep 6, 2019

consle模块提供一个简单的调试控制台,类似于web浏览器提供的Javascript控制台,但是全局console对象不同于浏览器中的API那样总是同步的,也不像其他Node流那样总是异步的

文档部分

  • Console类
    • new Console(stdout[, stderr][ ignoreerrors])
    • new Console(options)
    • console.assert(value[, …message])
    • console.clear()
    • console.count([label])
    • console.countReset([label])
    • console.debug(data[, ...args]):console.log()别名
    • console.dir(obj[, options])
    • console.dirxml(…data)
    • console.error([data][, …args]):使用换行符打印到stderr
    • console.group([…lable])
    • console.groupCollasped()d
    • console.groupEnd()
    • console.info([data][, …args])
    • console.log([data][, …args])
    • console.table(tabularData[, properties])
    • console.time([label])
    • console.timeEnd([lable])
    • console.timeLog([label][, …data]):同时data参数一同打印到stdout中
    • console.trace([message][, …args])
    • console.warn([data][, …args])
    • 用于调试的方法(需要与检查器 —inspect标志)一起使用,否则不显示任何内容
      • console.markTimeLine([label])
      • console.profile([label]):在性能面板中查看
      • console.profileEnd([label])
      • console.timeStamp([label]):检查器的Timeline面板中
      • console.timeline([label])
      • console.timelineEnd([label])

理解部分

@Genluo Genluo added the Node Node相关 label Sep 6, 2019
@Genluo
Copy link
Owner Author

Genluo commented Nov 27, 2019

node中如何拦截console的输出?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Node Node相关
Projects
None yet
Development

No branches or pull requests

1 participant