| Index: base/syslog_logging.cc
|
| diff --git a/base/syslog_logging.cc b/base/syslog_logging.cc
|
| index 087b4fd4543195d14bc38b040e58ec5314436f39..3818a146930fbf3e04cdc817159c82ce547672c5 100644
|
| --- a/base/syslog_logging.cc
|
| +++ b/base/syslog_logging.cc
|
| @@ -2,20 +2,16 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#include "base/debug/stack_trace.h"
|
| #include "base/syslog_logging.h"
|
|
|
| #if defined(OS_WIN)
|
| #include "base/bind.h"
|
| #include "base/callback_helpers.h"
|
| -#include "base/win/eventlog_messages.h"
|
| -
|
| -#include <windows.h>
|
| +#include "base/debug/stack_trace.h"
|
| #elif defined(OS_LINUX)
|
| #include <syslog.h>
|
| #endif
|
|
|
| -#include <cstring>
|
| #include <ostream>
|
| #include <string>
|
|
|
| @@ -24,13 +20,22 @@ namespace logging {
|
| #if defined(OS_WIN)
|
|
|
| namespace {
|
| +
|
| std::string* g_event_source_name = nullptr;
|
| -}
|
| +uint16_t g_category = 0;
|
| +uint32_t g_event_id = 0;
|
| +
|
| +} // namespace
|
|
|
| -void SetEventSourceName(const std::string& name) {
|
| +void SetEventSource(const std::string& name,
|
| + uint16_t category,
|
| + uint32_t event_id) {
|
| DCHECK_EQ(nullptr, g_event_source_name);
|
| g_event_source_name = new std::string(name);
|
| + g_category = category;
|
| + g_event_id = event_id;
|
| }
|
| +
|
| #endif // defined(OS_WIN)
|
|
|
| EventLogMessage::EventLogMessage(const char* file,
|
| @@ -48,8 +53,8 @@ EventLogMessage::~EventLogMessage() {
|
| return;
|
|
|
| HANDLE event_log_handle =
|
| - RegisterEventSourceA(NULL, g_event_source_name->c_str());
|
| - if (event_log_handle == NULL) {
|
| + RegisterEventSourceA(nullptr, g_event_source_name->c_str());
|
| + if (event_log_handle == nullptr) {
|
| stream() << " !!NOT ADDED TO EVENTLOG!!";
|
| return;
|
| }
|
| @@ -75,8 +80,8 @@ EventLogMessage::~EventLogMessage() {
|
| break;
|
| }
|
| LPCSTR strings[1] = {message.data()};
|
| - if (!ReportEventA(event_log_handle, log_type, BROWSER_CATEGORY,
|
| - MSG_LOG_MESSAGE, NULL, 1, 0, strings, NULL)) {
|
| + if (!ReportEventA(event_log_handle, log_type, g_category, g_event_id, nullptr,
|
| + 1, 0, strings, nullptr)) {
|
| stream() << " !!NOT ADDED TO EVENTLOG!!";
|
| }
|
| #elif defined(OS_LINUX)
|
|
|