Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(102)

Unified Diff: remoting/base/util.cc

Issue 7355011: Modify Chromoting logging to hook into base logging. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add timestamp Created 9 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: remoting/base/util.cc
diff --git a/remoting/base/util.cc b/remoting/base/util.cc
index 93410502f997ebcc5ada457f7283353b2be198f2..cf7c4105527ac8267c69b93455f7ee0be104b24a 100644
--- a/remoting/base/util.cc
+++ b/remoting/base/util.cc
@@ -2,16 +2,30 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "base/logging.h"
+#include "base/stringprintf.h"
#include "media/base/video_frame.h"
#include "media/base/yuv_convert.h"
#include "remoting/base/util.h"
-#include "base/logging.h"
-
using media::VideoFrame;
namespace remoting {
+std::string GetTimestampString() {
+ time_t t = time(NULL);
+ struct tm local_time = {0};
+#if _MSC_VER >= 1400
dmac 2011/07/21 23:37:07 add a comment about this?
garykac 2011/08/02 00:15:37 Added a comment to the block of code since this wa
+ localtime_s(&local_time, &t);
+#else
+ localtime_r(&t, &local_time);
+#endif
+ struct tm* tm_time = &local_time;
dmac 2011/07/21 23:37:07 why not just use local_time. instead of tm_time?
garykac 2011/08/02 00:15:37 To duplicate behavior from LogMessage
+ return StringPrintf("%02d%02d/%02d%02d%02d:",
+ 1 + tm_time->tm_mon, tm_time->tm_mday,
+ tm_time->tm_hour, tm_time->tm_min, tm_time->tm_sec);
+}
+
int GetBytesPerPixel(VideoFrame::Format format) {
// Note: The order is important here for performance. This is sorted from the
// most common to the less common (PIXEL_FORMAT_ASCII is mostly used

Powered by Google App Engine
This is Rietveld 408576698