Difference: LogFiles (1 vs. 2)

Revision 22015-03-31 - JimSkon

Line: 1 to 1
 
META TOPICPARENT name="SDProject32015"

Log Files

Changed:
<
<
%CODE{"c++"}% // Comment out to stop logging #define logging
>
>
%CODE{"c++"}% // Comment out to stop logging #define logging
  // Logfile #ifdef logging const char* LogFile = "/tmp/skonsslookup.log"; ofstream logFile;
Changed:
<
<
#define log(message) logFile << message << endl
>
>
string timestamp() { time_t _tm =time(NULL ); struct tm * curtime = localtime ( &_tm ); string t = asctime(curtime); t.erase(t.end() - 1); return t; } #define log(message) logFile << timestamp() << ": " << message << endl
 #else #define log(message) #endif
Changed:
<
<
// In the mainline of the program #ifdef logging logFile.open(LogFile ,ios::out); #endif
>
>
// In the mainline of the program #ifdef logging logFile.open(LogFile ,ios::out); #endif
 
Changed:
<
<
// Writing a log message log("Request: "+searchString);
>
>
// Writing a log message log("Request: "+searchString);
 %ENDCODE% \ No newline at end of file

Revision 12015-03-30 - JimSkon

Line: 1 to 1
Added:
>
>
META TOPICPARENT name="SDProject32015"

Log Files

<-- SyntaxHighlightingPlugin -->
// Comment out to stop logging
#define logging


// Logfile                                                                                             
#ifdef logging
const char* LogFile =  "/tmp/skonsslookup.log";
ofstream logFile;
#define log(message) logFile << message << endl
#else
#define log(message)
#endif

// In the mainline of the program
#ifdef logging
  logFile.open(LogFile,ios::out);
#endif

// Writing a log message
  log("Request: "+searchString);
<-- end SyntaxHighlightingPlugin -->
 
This site is powered by the TWiki collaboration platformCopyright &© by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback