windows下log的重定向输出
来源:互联网 发布:各种编程语言的区别 编辑:程序博客网 时间:2024/06/04 18:42
可以为应用程序创建一个关联的DOS窗口,然后把输出重定向到窗口,查看输出log
AllocConsole();
freopen("CONOUT$", "w", stdout);
根据时间将log输出到日志文件
time_t timep;
time(&timep);
struct tm *p = localtime(&timep);
char szBuff[64] = {0};
sprintf(szBuff, "%d-%d-%d %d:%d:%d.log", (1900 + p->tm_year), (1 + p->tm_mon), p->tm_mday, p->tm_hour, p->tm_min, p->tm_sec);
std::string str = szBuff;
std::size_t pos = str.find(":");
while (pos != std::string::npos)
{
str.replace(pos, 1, ":");
pos = str.find(":");
}
freopen(str.c_str(), "w", stdout);
0 0
- windows下log的重定向输出
- Ubuntu下如何用ABD logcat 重定向Log输出
- wxpython的重定向到log输出窗口
- 使Log4j的log输出重定向到指定函数
- Linux Shell 下的输出重定向
- Linux Shell 下的输出重定向
- Linux Shell 下的输出重定向
- linux 下的输出重定向
- Linux Shell 下的输出重定向
- Linux Shell 下的输出重定向
- Linux Shell 下的输出重定向
- Linux Shell 下的输出重定向
- Linux下的输入/输出重定向
- Linux Shell 下的输出重定向
- Linux Shell 下的输出重定向
- Linux下的输入/输出重定向
- Linux下的输入/输出重定向
- Linux下的输入/输出重定向
- 阿里云服务器mysql远程登录
- Maven(一)——安装(包括Eclipse的Maven插件)
- 在Ubuntu14.04上安装Hadoop
- @autowired和@Resource
- 取得中科院分词等相关系统的授权
- windows下log的重定向输出
- [leetcode] Simplify Path
- ERROR 1197 (HY000)
- 汇编语言的数据段内的问号'?'表示多大的值?
- 8A - Train and Peter
- 完美集群监控组合ganglia和nagios
- HDU 1108
- gmaping建图环境
- EventBus深入浅析之基本使用