加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

swift – print()到控制台日志的颜色

发布时间:2020-12-14 05:25:40 所属栏目:百科 来源:网络整理
导读:代码是: let redColor = "u{001B}[0;31m"var message = "Some Message"print(redColor + message) //This doesnt workprint("(redColor)(message)" //This also doesnt work 输出看起来像这样: [0;31mSome Message 我也读过这篇文章:Color ouput with
代码是:
let redColor = "u{001B}[0;31m"
var message = "Some Message"
print(redColor + message)  //This doesnt work
print("(redColor)(message)" //This also doesnt work

输出看起来像这样:

[0;31mSome Message

我也读过这篇文章:Color ouput with Swift command line tool,它似乎不起作用.

我不想使用库.

如今,Xcode调试控制台不支持着色.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读