cocos2d-JS cc.log日志输出

举报
鱼酱 发表于 2022/01/07 00:22:38 2022/01/07
【摘要】 1.error error ( obj subst ) 输出错误消息到 Cocos Creator 编辑器的 Console 或运行时页面端的 Console 中。 在 Cocos Creator 中,错误信息显示是红色的。 在 Chrome 中...

1.error

error
(
  • obj
  • subst
)

输出错误消息到 Cocos Creator 编辑器的 Console 或运行时页面端的 Console 中。

  • 在 Cocos Creator 中,错误信息显示是红色的。
  • 在 Chrome 中,错误信息有红色的图标以及红色的消息文本。
名称 类型 描述
obj Any

A JavaScript string containing zero or more substitution strings.

subst Any

JavaScript objects with which to replace substitution strings within msg. This gives you additional control over the format of the output.




2.warn


warn
(
  • obj
  • subst
)

输出警告消息到 Cocos Creator 编辑器的 Console 或运行时 Web 端的 Console 中。

  • 在 Cocos Creator 中,警告信息显示是黄色的。
  • 在 Chrome 中,警告信息有着黄色的图标以及黄色的消息文本。
名称 类型 描述
obj Any

A JavaScript string containing zero or more substitution strings.

subst Any

JavaScript objects with which to replace substitution strings within msg. This gives you additional control over the format of the output.

3.log

log
(
  • obj
  • subst
)

输出一条消息到 Cocos Creator 编辑器的 Console 或运行时 Web 端的 Console 中。

名称 类型 描述
obj Any

A JavaScript string containing zero or more substitution strings.

subst Any

JavaScript objects with which to replace substitution strings within msg. This gives you additional control over the format of the output.

4.info

info
(
  • obj
  • subst
)

输出一条信息消息到 Cocos Creator 编辑器的 Console 或运行时 Web 端的 Console 中。

  • 在 Cocos Creator 中,Info 信息显示是蓝色的。
  • 在 Firefox 和 Chrome 中,Info 信息有着小 “i” 图标。
名称 类型 描述
obj Any

A JavaScript string containing zero or more substitution strings.

subst Any

JavaScript objects with which to replace substitution strings within msg. This gives you additional control over the format of the output.

文章来源: yujiang.blog.csdn.net,作者:鱼酱2333,版权归原作者所有,如需转载,请联系作者。

原文链接:yujiang.blog.csdn.net/article/details/52979919

【版权声明】本文为华为云社区用户转载文章,如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@huaweicloud.com
  • 点赞
  • 收藏
  • 关注作者

评论(0

0/1000
抱歉,系统识别当前为高风险访问,暂不支持该操作

全部回复

上滑加载中

设置昵称

在此一键设置昵称,即可参与社区互动!

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。