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

Unified Diff: shill_logging.h

Issue 6575006: Add initial sketch to shill repository (Closed) Base URL: ssh://git@gitrw.chromium.org/shill.git@master
Patch Set: A few object renames and pointer conversions Created 9 years, 8 months 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 | « shill_event.cc ('k') | shill_logging.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: shill_logging.h
diff --git a/shill_logging.h b/shill_logging.h
new file mode 100644
index 0000000000000000000000000000000000000000..554e5e69e302e5572c2b9e0db494457f34c98df2
--- /dev/null
+++ b/shill_logging.h
@@ -0,0 +1,26 @@
+#include <glog/logging.h>
+
+#define SHILL_LOG_DAEMON 1
+#define SHILL_LOG_CONFIG 2
+#define SHILL_LOG_EVENT 4
+#define SHILL_LOG_DBUS 8
+#define SHILL_LOG_MANAGER 16
+#define SHILL_LOG_SERVICE 32
+#define SHILL_LOG_DEVICE 64
+#define SHILL_LOG_ALL ~0
+
+#define SHILL_LOG(level, flags) LOG_IF(level, shill::Log::IsEnabled(flags))
+
+#define SHILL_LOG_FILE "/tmp/shill_daemon.log"
+
+namespace shill {
+class Log {
+ public:
+ static void Enable(uint32_t flags) { flags_ |= flags; }
+ static void Disable(uint32_t flags) { flags_ &= ~flags; }
+ static inline bool IsEnabled(uint32_t flags) { return (flags_ & flags) != 0; }
+
+ private:
+ static uint32_t flags_;
+};
+} // namespace shill
« no previous file with comments | « shill_event.cc ('k') | shill_logging.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698