?? ps_usp_log.cpp
字號:
// PS_usp_log.cpp: implementation of the PS_usp_log class.
//
//////////////////////////////////////////////////////////////////////
#include "PS_usp_log.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
//#define LOG_FILE_NAME "/home/kevin/ku6cut/log/ku6cut.log"//"/home/kevin/log/debug.log" //上傳操作的日志
//#define DEBUG_FILE_NAME "/home/kevin/ku6cut/log/ku6debug.log"//"/home/kevin/log/debugflie.log" //上傳操作的日志
CUspLog::CUspLog(char * logname)
{
fp_logfile=fopen(logname,"a+");
}
CUspLog::~CUspLog()
{
}
/***************************************************************************
writeLog
****************************************************************************/
/*
void CUspLog::processLog(char * log)
{
//char l_tmp[1280] = {0};
//sprintf(l_tmp,"%s",log);
//fwrite(l_tmp,sizeof(char),strlen(log),fp_logfile);
fwrite(log,sizeof(char),strlen(log),fp_logfile);
}
*/
//可以傳很大的log都沒有問題
void CUspLog::writeLog(char * log)
{
/**
char l_tmp[128] = {0};
sprintf(l_tmp,"%s\r\n",log);
fwrite(l_tmp,sizeof(char),strlen(l_tmp),fp_logfile);
*/
fwrite(log,sizeof(char),strlen(log),fp_logfile);
}
void CUspLog::writeLog(int intvalue)
{
char l_tmp[100] = {0};
sprintf(l_tmp,"%d",intvalue);
fwrite(l_tmp,sizeof(char),strlen(l_tmp),fp_logfile);
}
void CUspLog::writeLog(char * msginfo, float numinfo)
{
char l_tmp[128] = {0};
sprintf(l_tmp,"%s%f\r\n",msginfo,numinfo);
fwrite(l_tmp,sizeof(char),strlen(l_tmp),fp_logfile);
}
void CUspLog::writeLog(char * msginfo, int numinfo)
{
char l_tmp[128] = {0};
sprintf(l_tmp,"%s%d\r\n",msginfo,numinfo);
fwrite(l_tmp,sizeof(char),strlen(l_tmp),fp_logfile);
}
void CUspLog::writeLog(char * msginfo,char * numinfo)
{
char l_tmp[128] = {0};
sprintf(l_tmp,"%s%s\r\n",msginfo,numinfo);
fwrite(l_tmp,sizeof(char),strlen(l_tmp),fp_logfile);
}
void CUspLog::closeLog(){
if(fp_logfile!=NULL)
{
fclose(fp_logfile);
}
}
void CUspLog::debugLog(char * debuglogname,char * debuglog){
FILE * debug_logfile=fopen(debuglogname,"a+");
fwrite(debuglog,sizeof(char),strlen(debuglog),debug_logfile);
fclose(debug_logfile);
}
void CUspLog::debugLog(char * debuglogname,int intvalue)
{
char l_tmp[50] = {0};
sprintf(l_tmp,"%d",intvalue);
debugLog(debuglogname,l_tmp);
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -