| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "sync/api/sync_error.h" | 5 #include "sync/api/sync_error.h" |
| 6 | 6 |
| 7 #include <ostream> | 7 #include <ostream> |
| 8 | 8 |
| 9 #include "base/location.h" | 9 #include "base/location.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 if (!IsSet()) { | 142 if (!IsSet()) { |
| 143 return std::string(); | 143 return std::string(); |
| 144 } | 144 } |
| 145 return location_->ToString() + ", " + ModelTypeToString(model_type_) + | 145 return location_->ToString() + ", " + ModelTypeToString(model_type_) + |
| 146 " " + GetMessagePrefix() + message_; | 146 " " + GetMessagePrefix() + message_; |
| 147 } | 147 } |
| 148 | 148 |
| 149 void SyncError::PrintLogError() const { | 149 void SyncError::PrintLogError() const { |
| 150 logging::LogSeverity logSeverity = | 150 logging::LogSeverity logSeverity = |
| 151 (GetSeverity() == SYNC_ERROR_SEVERITY_INFO) | 151 (GetSeverity() == SYNC_ERROR_SEVERITY_INFO) |
| 152 ? logging::LOG_INFO : logging::LOG_ERROR; | 152 ? logging::LOG_VERBOSE : logging::LOG_ERROR; |
| 153 | 153 |
| 154 LAZY_STREAM(logging::LogMessage(location_->file_name(), | 154 LAZY_STREAM(logging::LogMessage(location_->file_name(), |
| 155 location_->line_number(), | 155 location_->line_number(), |
| 156 logSeverity).stream(), | 156 logSeverity).stream(), |
| 157 logSeverity >= ::logging::GetMinLogLevel()) | 157 logSeverity >= ::logging::GetMinLogLevel()) |
| 158 << ModelTypeToString(model_type_) << " " | 158 << ModelTypeToString(model_type_) << " " |
| 159 << GetMessagePrefix() << message_; | 159 << GetMessagePrefix() << message_; |
| 160 } | 160 } |
| 161 | 161 |
| 162 void PrintTo(const SyncError& sync_error, std::ostream* os) { | 162 void PrintTo(const SyncError& sync_error, std::ostream* os) { |
| 163 *os << sync_error.ToString(); | 163 *os << sync_error.ToString(); |
| 164 } | 164 } |
| 165 | 165 |
| 166 } // namespace syncer | 166 } // namespace syncer |
| OLD | NEW |