打印控制台->字体与颜色
2023-04-18 15:37:36 时间
方法如何??
/**
* @param content 文本内容
* @param colour 颜色代号:31->红色、32->黄色、33->橙色、34->蓝色、35->紫色、36->绿色
* @param type 样式代号:0无;1加粗;3斜体;4下划线
* @return
*/
private static String getFormatLogString(String content, int colour, int type) {
boolean hasType = type != 1 && type != 3 && type != 4;
if (hasType) {
return String.format(" 33[%dm%s 33[0m", colour, content);
} else {
return String.format(" 33[%d;%dm%s 33[0m", colour, type, content);
}
}
如果使用??
/**
* 打印log.info也不印象
*/
System.out.println(getFormatLogString("唐僧",32,0))
相关文章
- RapidJson递归去除空值元素Value
- LeetCode笔记:232. Implement Queue using Stacks
- 怎么在jupyter中添加文件?
- LeetCode笔记:234. Palindrome Linked List
- LeetCode笔记:235. Lowest Common Ancestor of a Binary Search Tree
- LeetCode笔记:237. Delete Node in a Linked List
- [译]TensorFlow Serving RESTful API
- LeetCode笔记:238. Product of Array Except Self
- Spring Boot 2.6 重磅发布!!!
- 如何权衡人工智能与气候变化?两大组织联手交出了一份答卷
- pycharm中怎么创建Django项目django
- 钱德沛、张亚勤、罗智泉等人当选,清华、浙大、同济领衔!2021年两院院士增选结果正式揭晓
- GAN“家族”又添新成员——EditGAN,不但能自己修图,还修得比你我都好
- 既快又准并且低开销!一作亲解MICRO 2021最佳论文:一种自动化功耗模拟架构
- NeurIPS 2021 Spotlight | 针对有缺失坐标的聚类问题的核心集
- 为提高能量利用效率,大脑练就了预测感知能力
- LeetCode笔记:242. Valid Anagram
- 你需要了解的17个网络安全概念
- 装好jupyter后打开后界面什么都没有怎么解决?
- 美国将阻止SK海力士无锡工厂获得EUV光刻机;比亚迪36岁员工猝死:连续夜班、每班12h;上海法规严禁互联网平台利用算法“杀熟”