| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/chromeos/system_logs/device_event_log_source.h" |
| 6 |
| 7 #include "base/message_loop/message_loop.h" |
| 8 #include "chromeos/device_event_log.h" |
| 9 #include "content/public/browser/browser_thread.h" |
| 10 |
| 11 namespace system_logs { |
| 12 |
| 13 const char kNetworkEventLogEntry[] = "network_event_log"; |
| 14 const char kDeviceEventLogEntry[] = "device_event_log"; |
| 15 |
| 16 DeviceEventLogSource::DeviceEventLogSource() |
| 17 : SystemLogsSource("DeviceEvent") { |
| 18 } |
| 19 |
| 20 DeviceEventLogSource::~DeviceEventLogSource() { |
| 21 } |
| 22 |
| 23 void DeviceEventLogSource::Fetch(const SysLogsSourceCallback& callback) { |
| 24 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); |
| 25 DCHECK(!callback.is_null()); |
| 26 |
| 27 scoped_ptr<SystemLogsResponse> response(new SystemLogsResponse); |
| 28 const int kMaxDeviceEventsForAboutSystem = 400; |
| 29 (*response)[kNetworkEventLogEntry] = |
| 30 chromeos::device_event_log::GetAsString( |
| 31 chromeos::device_event_log::OLDEST_FIRST, |
| 32 "time,file,level", |
| 33 chromeos::device_event_log::LOG_TYPE_NETWORK, |
| 34 chromeos::device_event_log::kDefaultLogLevel, |
| 35 kMaxDeviceEventsForAboutSystem); |
| 36 (*response)[kDeviceEventLogEntry] = |
| 37 chromeos::device_event_log::GetAsString( |
| 38 chromeos::device_event_log::OLDEST_FIRST, |
| 39 "time,file,level", |
| 40 chromeos::device_event_log::LOG_TYPE_NON_NETWORK, |
| 41 chromeos::device_event_log::kDefaultLogLevel, |
| 42 kMaxDeviceEventsForAboutSystem); |
| 43 callback.Run(response.get()); |
| 44 } |
| 45 |
| 46 } // namespace system_logs |
| OLD | NEW |