| 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" |
| 11 #include "sync/internal_api/public/syncable/model_type.h" | 11 #include "sync/internal_api/public/syncable/model_type.h" |
| 12 | 12 |
| 13 namespace csync { |
| 14 |
| 13 SyncError::SyncError() { | 15 SyncError::SyncError() { |
| 14 Clear(); | 16 Clear(); |
| 15 } | 17 } |
| 16 | 18 |
| 17 SyncError::SyncError(const tracked_objects::Location& location, | 19 SyncError::SyncError(const tracked_objects::Location& location, |
| 18 const std::string& message, | 20 const std::string& message, |
| 19 syncable::ModelType type) { | 21 syncable::ModelType type) { |
| 20 Init(location, message, type); | 22 Init(location, message, type); |
| 21 PrintLogError(); | 23 PrintLogError(); |
| 22 } | 24 } |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 LAZY_STREAM(logging::LogMessage(location_->file_name(), | 101 LAZY_STREAM(logging::LogMessage(location_->file_name(), |
| 100 location_->line_number(), | 102 location_->line_number(), |
| 101 logging::LOG_ERROR).stream(), | 103 logging::LOG_ERROR).stream(), |
| 102 LOG_IS_ON(ERROR)) | 104 LOG_IS_ON(ERROR)) |
| 103 << syncable::ModelTypeToString(type_) << ", Sync Error: " << message_; | 105 << syncable::ModelTypeToString(type_) << ", Sync Error: " << message_; |
| 104 } | 106 } |
| 105 | 107 |
| 106 void PrintTo(const SyncError& sync_error, std::ostream* os) { | 108 void PrintTo(const SyncError& sync_error, std::ostream* os) { |
| 107 *os << sync_error.ToString(); | 109 *os << sync_error.ToString(); |
| 108 } | 110 } |
| 111 |
| 112 } // namespace csync |
| 113 |
| OLD | NEW |