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

Unified Diff: chromeos/network/network_event_log.h

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chromeos/chromeos_test_utils.cc ('k') | chromeos/network/network_event_log.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/network/network_event_log.h
diff --git a/chromeos/network/network_event_log.h b/chromeos/network/network_event_log.h
index be5a2e45077d9f126fd7d0d11f3ca3dd264fd4b1..293144c5931d3617af074b234ba8f4fb0cecffa3 100644
--- a/chromeos/network/network_event_log.h
+++ b/chromeos/network/network_event_log.h
@@ -9,6 +9,7 @@
#include <string>
#include "base/basictypes.h"
+#include "base/stringprintf.h"
#include "base/time.h"
#include "chromeos/chromeos_export.h"
@@ -45,6 +46,19 @@ CHROMEOS_EXPORT void AddEntry(const std::string& module,
// output the events. If |max_events| > 0, limits how many events are output.
CHROMEOS_EXPORT std::string GetAsString(StringOrder order, size_t max_events);
+// Macros to make logging format more consistent.
+#define NET_LOG(module, message) \
+ ::chromeos::network_event_log::AddEntry( \
+ module, \
+ std::string(__FILE__) + ":" + ::base::StringPrintf("%d",__LINE__) + \
+ " (" + std::string(__func__) + ")", \
+ message)
+
+#define NET_LOG_WARNING(module, message) \
+ NET_LOG(module, std::string("WARNING:") + message)
+#define NET_LOG_ERROR(module, message) \
+ NET_LOG(module, std::string("ERROR:") + message)
+
} // namespace network_event_log
} // namespace chromeos
« no previous file with comments | « chromeos/chromeos_test_utils.cc ('k') | chromeos/network/network_event_log.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698