platform_hardware_interfaces/configstore/utils/ConfigStoreUtils.cpp
Jaesoo Lee a8959849ba print log message for values retrieved from configstore
This CL adds a code for printing log messages in clients-side utility
library functions (getXXX) for configstore so that the developer can
figure out which configuration values are actually retrieved from the configstore.

Bug: 36275627
Test: Built and check the log message appears

Change-Id: I7d5d80ca7a0317816c71016e013f9e73ad23ee08
Merged-In: I2c0895f8afbbb2947b62164acaf62a491c451dc0
(cherry picked from commit 0dc72ecbb7)
2017-04-06 11:10:03 +09:00

40 lines
1 KiB
C++

//
// Copyright (C) 2017 The Android Open Source Project
//
// 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.
//
#define LOG_TAG "ConfigStore"
#include <android-base/logging.h>
#include <configstore/Utils.h>
namespace android {
namespace hardware {
namespace details {
bool wouldLogInfo() {
return WOULD_LOG(INFO);
}
void logAlwaysInfo(const std::string& message) {
LOG(INFO) << message;
}
void logAlwaysError(const std::string& message) {
LOG(ERROR) << message;
}
} // namespace details
} // namespace hardware
} // namespace android