Tags:
create new tag
view all tags
---+ Log Files %CODE{"c++"}% // Comment out to stop logging #define logging // Logfile #ifdef logging const char* LogFile = "/tmp/skonsslookup.log"; ofstream logFile; 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 // In the mainline of the program #ifdef logging logFile.open(LogFile,ios::out); #endif // Writing a log message log("Request: "+searchString); %ENDCODE%
E
dit
|
A
ttach
|
Watch
|
P
rint version
|
H
istory
: r2
<
r1
|
B
acklinks
|
V
iew topic
|
Ra
w
edit
|
M
ore topic actions
Topic revision: r2 - 2015-03-31
-
JimSkon
Home
Site map
Main web
Sandbox web
TWiki web
Main Web
Users
Groups
Index
Search
Changes
Notifications
RSS Feed
Statistics
Preferences
P
View
Raw View
Print version
Find backlinks
History
More topic actions
Edit
Raw edit
Attach file or image
Edit topic preference settings
Set new parent
More topic actions
Account
Log In
Register User
E
dit
A
ttach
Copyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback