Title: [136070] trunk/Source/WTF
- Revision
- 136070
- Author
- roger_f...@apple.com
- Date
- 2012-11-28 15:39:32 -0800 (Wed, 28 Nov 2012)
Log Message
Make DataLog work/compile properly on Windows.
https://bugs.webkit.org/show_bug.cgi?id=103544
Reviewed by Filip Pizlo.
* wtf/DataLog.cpp:
(WTF::initializeLogFileOnce):
Modified Paths
Diff
Modified: trunk/Source/WTF/ChangeLog (136069 => 136070)
--- trunk/Source/WTF/ChangeLog 2012-11-28 23:37:24 UTC (rev 136069)
+++ trunk/Source/WTF/ChangeLog 2012-11-28 23:39:32 UTC (rev 136070)
@@ -1,3 +1,13 @@
+2012-11-28 Roger Fong <roger_f...@apple.com>
+
+ Make DataLog work/compile properly on Windows.
+ https://bugs.webkit.org/show_bug.cgi?id=103544
+
+ Reviewed by Filip Pizlo.
+
+ * wtf/DataLog.cpp:
+ (WTF::initializeLogFileOnce):
+
2012-11-28 Filip Pizlo <fpi...@apple.com>
It should be possible to say dataLog("count = ", count, "\n") instead of dataLogF("count = %d\n", count)
Modified: trunk/Source/WTF/wtf/DataLog.cpp (136069 => 136070)
--- trunk/Source/WTF/wtf/DataLog.cpp 2012-11-28 23:37:24 UTC (rev 136069)
+++ trunk/Source/WTF/wtf/DataLog.cpp 2012-11-28 23:39:32 UTC (rev 136070)
@@ -44,6 +44,8 @@
// Uncomment to force logging to the given file regardless of what the environment variable says. Note that
// we will append ".<pid>.txt" where <pid> is the PID.
+
+// This path won't work on Windows, make sure to change to something like C:\\Users\\<more path>\\log.txt.
#define DATA_LOG_FILENAME "/tmp/WTFLog"
namespace WTF {
@@ -63,7 +65,13 @@
const char* filename = getenv("WTF_DATA_LOG_FILENAME");
#endif
char actualFilename[1024];
+
+#if PLATFORM(WIN)
+ _snprintf(actualFilename, sizeof(actualFilename), "%s.%d.txt", filename, GetCurrentProcessId());
+#else
snprintf(actualFilename, sizeof(actualFilename), "%s.%d.txt", filename, getpid());
+#endif
+
if (filename) {
FILE* rawFile = fopen(actualFilename, "w");
if (rawFile)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes