Commit 144fb9d2 authored by Marc Treib's avatar Marc Treib Committed by Commit Bot

Delete unused Logger class in components/invalidation

Bug: none
Change-Id: I0bce94804ed7d9877ca2189a56e139e75eb47550
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1943178
Commit-Queue: Marc Treib <treib@chromium.org>
Commit-Queue: Mohamed Amir Yosef <mamir@chromium.org>
Auto-Submit: Marc Treib <treib@chromium.org>
Reviewed-by: default avatarMohamed Amir Yosef <mamir@chromium.org>
Cr-Commit-Position: refs/heads/master@{#720186}
parent e1ca7a23
......@@ -48,8 +48,6 @@ static_library("impl") {
"invalidator_registrar_with_memory.h",
"invalidator_storage.cc",
"invalidator_storage.h",
"logger.cc",
"logger.h",
"mock_ack_handler.cc",
"mock_ack_handler.h",
"per_user_topic_registration_manager.cc",
......
......@@ -13,7 +13,6 @@
#include "components/invalidation/impl/channels_states.h"
#include "components/invalidation/impl/fcm_sync_network_channel.h"
#include "components/invalidation/impl/invalidation_listener.h"
#include "components/invalidation/impl/logger.h"
#include "components/invalidation/impl/per_user_topic_registration_manager.h"
#include "components/invalidation/impl/unacked_invalidation_set.h"
#include "components/invalidation/public/ack_handler.h"
......@@ -122,7 +121,6 @@ class FCMInvalidationListener : public InvalidationListener,
std::unique_ptr<FCMSyncNetworkChannel> network_channel_;
UnackedInvalidationsMap unacked_invalidations_map_;
Delegate* delegate_;
Logger logger_;
// Stored to pass to |per_user_topic_registration_manager_| on start.
Topics registered_topics_;
......
// Copyright 2018 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 "components/invalidation/impl/logger.h"
#include "base/logging.h"
#include "base/strings/stringprintf.h"
namespace syncer {
Logger::Logger() {}
Logger::~Logger() {}
void Logger::Log(LogLevel level,
const char* file,
int line,
const char* format,
...) {
logging::LogSeverity log_severity = -2; // VLOG(2)
bool emit_log = false;
switch (level) {
case FINE_LEVEL:
log_severity = -2; // VLOG(2)
emit_log = VLOG_IS_ON(2);
break;
case INFO_LEVEL:
log_severity = -1; // VLOG(1)
emit_log = VLOG_IS_ON(1);
break;
case WARNING_LEVEL:
log_severity = logging::LOG_WARNING;
emit_log = LOG_IS_ON(WARNING);
break;
case SEVERE_LEVEL:
log_severity = logging::LOG_ERROR;
emit_log = LOG_IS_ON(ERROR);
break;
}
if (emit_log) {
va_list ap;
va_start(ap, format);
std::string result;
base::StringAppendV(&result, format, ap);
logging::LogMessage(file, line, log_severity).stream() << result;
va_end(ap);
}
}
} // namespace syncer
// Copyright 2018 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.
#ifndef COMPONENTS_INVALIDATION_IMPL_LOGGER_H_
#define COMPONENTS_INVALIDATION_IMPL_LOGGER_H_
#include <string>
#define TLOG(logger, level, str, ...) \
logger->Log(Logger::level##_LEVEL, __FILE__, __LINE__, str, ##__VA_ARGS__);
namespace syncer {
// Forward logging messages to the approppriate channel.
class Logger {
public:
enum LogLevel { FINE_LEVEL, INFO_LEVEL, WARNING_LEVEL, SEVERE_LEVEL };
Logger();
~Logger();
// invalidation::Logger implementation.
void Log(LogLevel level, const char* file, int line, const char* format, ...);
};
} // namespace syncer
#endif // COMPONENTS_INVALIDATION_IMPL_LOGGER_H_
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment