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

Unified Diff: src/platform/crash/system_logging.cc

Issue 1702008: Add crash_reporter functionality (Closed)
Patch Set: add set -e Created 10 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 | « src/platform/crash/system_logging.h ('k') | src/platform/crash/system_logging_mock.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/platform/crash/system_logging.cc
diff --git a/src/platform/crash/system_logging.cc b/src/platform/crash/system_logging.cc
new file mode 100644
index 0000000000000000000000000000000000000000..e366ef2c2d197ee7346c47c33c3923c36987d81b
--- /dev/null
+++ b/src/platform/crash/system_logging.cc
@@ -0,0 +1,44 @@
+// Copyright (c) 2010 The Chromium OS 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 <stdarg.h>
+#include <syslog.h>
+
+#include "crash/system_logging.h"
+
+std::string SystemLoggingImpl::identity_;
+
+SystemLoggingImpl::SystemLoggingImpl() {
+}
+
+SystemLoggingImpl::~SystemLoggingImpl() {
+}
+
+void SystemLoggingImpl::Initialize(const char *ident) {
+ // Man page does not specify if openlog copies its string or assumes
+ // the pointer is always valid, so make its scope global.
+ identity_ = ident;
+ openlog(identity_.c_str(), LOG_PID, LOG_USER);
+}
+
+void SystemLoggingImpl::LogInfo(const char *format, ...) {
+ va_list vl;
+ va_start(vl, format);
+ vsyslog(LOG_INFO, format, vl);
+ va_end(vl);
+}
+
+void SystemLoggingImpl::LogWarning(const char *format, ...) {
+ va_list vl;
+ va_start(vl, format);
+ vsyslog(LOG_WARNING, format, vl);
+ va_end(vl);
+}
+
+void SystemLoggingImpl::LogError(const char *format, ...) {
+ va_list vl;
+ va_start(vl, format);
+ vsyslog(LOG_ERR, format, vl);
+ va_end(vl);
+}
« no previous file with comments | « src/platform/crash/system_logging.h ('k') | src/platform/crash/system_logging_mock.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698