Index: base/time/time_logging.h |
diff --git a/base/time/time_logging.h b/base/time/time_logging.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..f546048ed1f8ab56f2b6bf52d4632d8dbb9889ad |
--- /dev/null |
+++ b/base/time/time_logging.h |
@@ -0,0 +1,34 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+// C++ iostream operators for logging base::Time, base::TimeDelta and |
+// base::TimeTicks objects. For use with DCHECK_EQ(), DCHECK_LE(), etc. This |
+// file is separated from time.h to avoid the iostream dependency, and also |
+// because these operators should only be used for logging. |
+// |
+// Never use these methods to format user-visible strings. See |
+// "base/i18n/time_formatting.h" instead. |
mmenke
2014/10/21 14:20:09
Optional: I think it's more common to put file-le
Adam Rice
2014/10/23 01:13:02
True. I merged the functionality into time.h anywa
|
+ |
+#ifndef BASE_TIME_TIME_LOGGING_H_ |
+#define BASE_TIME_TIME_LOGGING_H_ |
+ |
+#include <iosfwd> |
+ |
+#include "base/base_export.h" |
+ |
+namespace base { |
+ |
+class Time; |
+class TimeDelta; |
+class TimeTicks; |
+ |
+BASE_EXPORT std::ostream& operator<<(std::ostream& os, |
+ const TimeDelta& time_delta); |
+BASE_EXPORT std::ostream& operator<<(std::ostream& os, const Time& time); |
+BASE_EXPORT std::ostream& operator<<(std::ostream& os, |
+ const TimeTicks& time_ticks); |
+ |
+} // namespace base |
+ |
+#endif // BASE_TIME_TIME_LOGGING_H_ |