MCPcopy Create free account
hub / github.com/MaxBelkov/visualsyslog / WriteToLogTime

Function WriteToLogTime

sourcecommon/utils.cpp:400–419  ·  view source on GitHub ↗

---------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

398extern char szLogFile[];
399//---------------------------------------------------------------------------
400void WriteToLogTime(char * fmt, bool savetime, ...)
401{
402 char str[1000];
403 va_list argptr;
404 va_start(argptr, savetime);
405 wvsprintf(str, fmt, argptr);
406 va_end(argptr);
407 //
408 TDateTime t = Now();
409 char szTime[40];
410 if( savetime )
411 wsprintf(szTime, "%s %s ", t.DateString().c_str(), t.TimeString().c_str());
412 else
413 *szTime=0;
414 //
415 TFile out(szLogFile, GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL);
416 if( !out ) return;
417 out.SetPointer(0, FILE_END);
418 out << szTime << str << "\r\n";
419}
420//---------------------------------------------------------------------------
421// � ��� LanMon � � ������� ������ � � OPC DA server ���� ������� WriteToLog !
422#if !defined(ARMLanMon) && !defined(DANFOSS) && !defined(OPC_DA)

Callers

nothing calls this directly

Calls 1

SetPointerMethod · 0.80

Tested by

no test coverage detected