Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(518)

Side by Side Diff: chromeos/network/network_event_log.cc

Issue 11299236: This moves the ONC parsing code into chromeos/network/onc (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix unit tests Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chromeos/network/network_event_log.h ('k') | chromeos/network/network_event_log_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "chromeos/network/network_event_log.h" 5 #include "chromeos/network/network_event_log.h"
6 6
7 #include "base/i18n/time_formatting.h" 7 #include "base/i18n/time_formatting.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/stringprintf.h" 10 #include "base/stringprintf.h"
(...skipping 25 matching lines...) Expand all
36 : module(module), 36 : module(module),
37 event(event), 37 event(event),
38 description(description), 38 description(description),
39 time(base::Time::Now()), 39 time(base::Time::Now()),
40 count(1) { 40 count(1) {
41 } 41 }
42 42
43 std::string LogEntry::ToString() const { 43 std::string LogEntry::ToString() const {
44 std::string line; 44 std::string line;
45 line += "[" + UTF16ToUTF8(base::TimeFormatShortDateAndTime(time)) + "]"; 45 line += "[" + UTF16ToUTF8(base::TimeFormatShortDateAndTime(time)) + "]";
46 line += " " + module + "." + event; 46 line += " " + module + ":" + event;
47 if (!description.empty()) 47 if (!description.empty())
48 line += ": " + description; 48 line += ": " + description;
49 if (count > 1) 49 if (count > 1)
50 line += StringPrintf(" (%d)", count); 50 line += StringPrintf(" (%d)", count);
51 line += "\n"; 51 line += "\n";
52 return line; 52 return line;
53 } 53 }
54 54
55 typedef std::deque<LogEntry> LogEntryList; 55 typedef std::deque<LogEntry> LogEntryList;
56 56
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 150
151 std::string GetAsString(StringOrder order, size_t max_events) { 151 std::string GetAsString(StringOrder order, size_t max_events) {
152 if (!g_network_event_log) 152 if (!g_network_event_log)
153 return "NetworkEventLog not intitialized."; 153 return "NetworkEventLog not intitialized.";
154 return g_network_event_log->GetAsString(order, max_events); 154 return g_network_event_log->GetAsString(order, max_events);
155 } 155 }
156 156
157 } // namespace network_event_log 157 } // namespace network_event_log
158 158
159 } // namespace chromeos 159 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/network/network_event_log.h ('k') | chromeos/network/network_event_log_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698