可可西

2010年12月27日 #

windows控制台中使用不同颜色显示不同类型的日志

摘要: 主要是使用函数”SetConsoleTextAttribute“来实现不同类型的日志,采用不同的颜色来打印日志内容。BOOL SetConsoleTextAttribute( HANDLE hConsoleOutput, // handle to console screen buffer WORD wAttributes // text and background colors);该函数对调用之后日志有效。HANDLEhConsoleOutput -- 输出窗口句柄WORDwAttributes -- 属性设置 可通过逻辑或运算符(|)连接各个属性分量+++++++++++++++++++ 阅读全文

posted @ 2010-12-27 16:34 可可西 阅读(1517) 评论(0) 推荐(2) 编辑

导航