CPP: Fix compilation error with -DUSE_GOOGLE_BASE
authorphilip.liard@gmail.com <philip.liard@gmail.com@ee073f10-1060-11df-b6a4-87a95322a99c>
Tue, 22 May 2012 11:09:54 +0000 (11:09 +0000)
committerphilip.liard@gmail.com <philip.liard@gmail.com@ee073f10-1060-11df-b6a4-87a95322a99c>
Tue, 22 May 2012 11:09:54 +0000 (11:09 +0000)
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.

git-svn-id: http://libphonenumber.googlecode.com/svn/trunk@456 ee073f10-1060-11df-b6a4-87a95322a99c

cpp/src/phonenumbers/default_logger.h

index 1cde2a5..d6ba050 100644 (file)
 #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;