Commits

Anonymous committed bd79b42

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.

Comments (0)

Files changed (1)

cpp/src/phonenumbers/default_logger.h

 #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
 #include <sstream>
 #include <string>
 
-#include "phonenumbers/logger.h"
-
 using std::string;
 using std::stringstream;
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.