Browse Source

CPP: Fix compilation error with -DUSE_GOOGLE_BASE

This removes the Chromium-specific (outdated) Logger interface from
default_logger.h.
The return type of set_logger_impl() differed from the one in logger.h (changed
in r430) which produced a compilation error in phonenumberutil.cc when
set_logger_impl() is used as a right value.

Logger, defined in logger.h is now used in all cases.
pull/567/head
Philippe Liard 14 years ago
committed by Mihaela Rosca
parent
commit
4934b45ef1
1 changed files with 4 additions and 20 deletions
  1. +4
    -20
      cpp/src/phonenumbers/default_logger.h

+ 4
- 20
cpp/src/phonenumbers/default_logger.h View File

@ -17,31 +17,17 @@
#ifndef I18N_PHONENUMBERS_DEFAULT_LOGGER_H_
#define I18N_PHONENUMBERS_DEFAULT_LOGGER_H_
#include "phonenumbers/logger.h"
#ifdef USE_GOOGLE_BASE
namespace i18n {
namespace phonenumbers {
// There is no Logger in the new base implementation - provide a NOP one.
class Logger {
public:
Logger() {}
virtual ~Logger() {}
static void set_logger_impl(Logger*) {}
};
// If Google base/ is used, LOG() and VLOG() from base/logging.h are used
// therefore the default logger implementation (StdoutLogger) instantiated in
// phonenumberutil will actually never be used. Thus provide a dummy
// implementation of this logger.
class StdoutLogger : public Logger {
public:
virtual ~StdoutLogger() {}
virtual void WriteLevel() {}
virtual void WriteMessage(const string& /* msg */) {}
};
// phonenumberutil will actually never be used.
typedef NullLogger StdoutLogger;
} // namespace phonenumbers
} // namespace i18n
@ -51,8 +37,6 @@ class StdoutLogger : public Logger {
#include <sstream>
#include <string>
#include "phonenumbers/logger.h"
using std::string;
using std::stringstream;


Loading…
Cancel
Save