| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/device_event_log/device_event_log_impl.h" | 5 #include "components/device_event_log/device_event_log_impl.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 #include <list> | 8 #include <list> |
| 9 #include <set> | 9 #include <set> |
| 10 | 10 |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 return text; | 150 return text; |
| 151 } | 151 } |
| 152 | 152 |
| 153 void SendLogEntryToVLogOrErrorLog( | 153 void SendLogEntryToVLogOrErrorLog( |
| 154 const DeviceEventLogImpl::LogEntry& log_entry) { | 154 const DeviceEventLogImpl::LogEntry& log_entry) { |
| 155 if (log_entry.log_level != LOG_LEVEL_ERROR && !VLOG_IS_ON(1)) | 155 if (log_entry.log_level != LOG_LEVEL_ERROR && !VLOG_IS_ON(1)) |
| 156 return; | 156 return; |
| 157 const bool show_time = true; | 157 const bool show_time = true; |
| 158 const bool show_file = true; | 158 const bool show_file = true; |
| 159 const bool show_type = true; | 159 const bool show_type = true; |
| 160 const bool show_level = false; | 160 const bool show_level = log_entry.log_level != LOG_LEVEL_ERROR; |
| 161 const bool format_html = false; | 161 const bool format_html = false; |
| 162 std::string output = LogEntryToString(log_entry, show_time, show_file, | 162 std::string output = LogEntryToString(log_entry, show_time, show_file, |
| 163 show_type, show_level, format_html); | 163 show_type, show_level, format_html); |
| 164 if (log_entry.log_level == LOG_LEVEL_ERROR) | 164 if (log_entry.log_level == LOG_LEVEL_ERROR) |
| 165 LOG(ERROR) << output; | 165 LOG(ERROR) << output; |
| 166 else | 166 else |
| 167 VLOG(1) << output; | 167 VLOG(1) << output; |
| 168 } | 168 } |
| 169 | 169 |
| 170 bool LogEntryMatches(const DeviceEventLogImpl::LogEntry& first, | 170 bool LogEntryMatches(const DeviceEventLogImpl::LogEntry& first, |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 401 if (filedesc) { | 401 if (filedesc) { |
| 402 file = filedesc; | 402 file = filedesc; |
| 403 size_t last_slash_pos = file.find_last_of("\\/"); | 403 size_t last_slash_pos = file.find_last_of("\\/"); |
| 404 if (last_slash_pos != std::string::npos) { | 404 if (last_slash_pos != std::string::npos) { |
| 405 file.erase(0, last_slash_pos + 1); | 405 file.erase(0, last_slash_pos + 1); |
| 406 } | 406 } |
| 407 } | 407 } |
| 408 } | 408 } |
| 409 | 409 |
| 410 } // namespace device_event_log | 410 } // namespace device_event_log |
| OLD | NEW |