diff --git a/cpp/src/phonenumbers/default_logger.cc b/cpp/src/phonenumbers/default_logger.cc index 538c1b30d..766e215a8 100644 --- a/cpp/src/phonenumbers/default_logger.cc +++ b/cpp/src/phonenumbers/default_logger.cc @@ -14,6 +14,9 @@ // Author: Philippe Liard +// This file should not be compiled when using Google base/. +#ifndef USE_GOOGLE_BASE + #include #include "phonenumbers/default_logger.h" @@ -47,3 +50,5 @@ void StdoutLogger::WriteLevel() { } // namespace phonenumbers } // namespace i18n + +#endif // USE_GOOGLE_BASE diff --git a/cpp/src/phonenumbers/default_logger.h b/cpp/src/phonenumbers/default_logger.h index 53ec9cd7a..28212ff7f 100644 --- a/cpp/src/phonenumbers/default_logger.h +++ b/cpp/src/phonenumbers/default_logger.h @@ -17,6 +17,28 @@ #ifndef I18N_PHONENUMBERS_DEFAULT_LOGGER_H_ #define I18N_PHONENUMBERS_DEFAULT_LOGGER_H_ +#ifdef USE_GOOGLE_BASE + +namespace i18n { +namespace phonenumbers { + +// 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 */) {} +}; + +} // namespace phonenumbers +} // namespace i18n + +#else + #include #include "phonenumbers/logger.h" @@ -103,4 +125,5 @@ class StdoutLogger : public Logger { } // namespace phonenumbers } // namespace i18n +#endif // USE_GOOGLE_BASE #endif // I18N_PHONENUMBERS_DEFAULT_LOGGER_H_ diff --git a/tools/java/common/test/com/google/i18n/phonenumbers/tools/BuildMetadataFromXmlTest.java b/tools/java/common/test/com/google/i18n/phonenumbers/tools/BuildMetadataFromXmlTest.java index 42fe782be..03d04924a 100644 --- a/tools/java/common/test/com/google/i18n/phonenumbers/tools/BuildMetadataFromXmlTest.java +++ b/tools/java/common/test/com/google/i18n/phonenumbers/tools/BuildMetadataFromXmlTest.java @@ -1,4 +1,18 @@ -// Copyright 2009 Google Inc. All Rights Reserved. +/* + * Copyright (C) 2011 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.google.i18n.phonenumbers.tools;