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

Unified Diff: mojo/services/flog/cpp/flog.cc

Issue 2008553006: Add 'Flog' formatted logging to mojo/services (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 7 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 | « mojo/services/flog/cpp/flog.h ('k') | mojo/services/flog/interfaces/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/services/flog/cpp/flog.cc
diff --git a/mojo/services/flog/cpp/flog.cc b/mojo/services/flog/cpp/flog.cc
new file mode 100644
index 0000000000000000000000000000000000000000..34936825a8e4d35012678a648df24104fd882afd
--- /dev/null
+++ b/mojo/services/flog/cpp/flog.cc
@@ -0,0 +1,37 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "mojo/services/flog/cpp/flog.h"
+
+namespace mojo {
+namespace flog {
+
+// static
+std::atomic_ulong Flog::last_allocated_channel_id_;
+
+// static
+FlogLoggerPtr Flog::logger_;
+
+FlogChannel::FlogChannel(const char* channel_type_name)
+ : id_(Flog::AllocateChannelId()) {
+ Flog::LogChannelCreation(id_, channel_type_name);
+}
+
+FlogChannel::~FlogChannel() {
+ Flog::LogChannelDeletion(id_);
+}
+
+bool FlogChannel::Accept(Message* message) {
+ Flog::LogChannelMessage(id_, message);
+ return true;
+}
+
+bool FlogChannel::AcceptWithResponder(Message* message,
+ MessageReceiver* responder) {
+ MOJO_DCHECK(false) << "Flog doesn't support messages with responses";
+ abort();
+}
+
+} // namespace flog
+} // namespace mojo
« no previous file with comments | « mojo/services/flog/cpp/flog.h ('k') | mojo/services/flog/interfaces/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698