| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/trace_event.h" | 5 #include "base/debug/trace_event.h" |
| 6 | 6 |
| 7 #include "base/format_macros.h" | 7 #include "base/format_macros.h" |
| 8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| 11 #include "base/platform_thread.h" | 11 #include "base/platform_thread.h" |
| 12 #include "base/process_util.h" | 12 #include "base/process_util.h" |
| 13 #include "base/stringprintf.h" | 13 #include "base/stringprintf.h" |
| 14 #include "base/utf_string_conversions.h" | 14 #include "base/utf_string_conversions.h" |
| 15 #include "base/time.h" | 15 #include "base/time.h" |
| 16 | 16 |
| 17 #define USE_UNRELIABLE_NOW | 17 #define USE_UNRELIABLE_NOW |
| 18 | 18 |
| 19 namespace base { | 19 namespace base { |
| 20 namespace debug { |
| 20 | 21 |
| 21 static const char* kEventTypeNames[] = { | 22 static const char* kEventTypeNames[] = { |
| 22 "BEGIN", | 23 "BEGIN", |
| 23 "END", | 24 "END", |
| 24 "INSTANT" | 25 "INSTANT" |
| 25 }; | 26 }; |
| 26 | 27 |
| 27 static const FilePath::CharType* kLogFileName = | 28 static const FilePath::CharType* kLogFileName = |
| 28 FILE_PATH_LITERAL("trace_%d.log"); | 29 FILE_PATH_LITERAL("trace_%d.log"); |
| 29 | 30 |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 | 155 |
| 155 Log(msg); | 156 Log(msg); |
| 156 } | 157 } |
| 157 | 158 |
| 158 void TraceLog::Log(const std::string& msg) { | 159 void TraceLog::Log(const std::string& msg) { |
| 159 AutoLock lock(file_lock_); | 160 AutoLock lock(file_lock_); |
| 160 | 161 |
| 161 fprintf(log_file_, "%s", msg.c_str()); | 162 fprintf(log_file_, "%s", msg.c_str()); |
| 162 } | 163 } |
| 163 | 164 |
| 164 } // namespace base | 165 } // namespace debug |
| 166 } // namespace base |
| OLD | NEW |