diff options
author | Jaesoo Lee <jaesoo@google.com> | 2017-03-24 14:08:24 +0900 |
---|---|---|
committer | Jaesoo Lee <jaesoo@google.com> | 2017-04-05 11:37:30 +0900 |
commit | 0dc72ecbb798971d6f394d7f4dbc9d1f4006da5f (patch) | |
tree | d4d8907bfd2fec2b88422330d5a1828d8c4ac514 /configstore/utils/ConfigStoreUtils.cpp | |
parent | 0dff6286ebab52f7f0d675e9474fdd5c7ac498bf (diff) |
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: I2c0895f8afbbb2947b62164acaf62a491c451dc0
Diffstat (limited to 'configstore/utils/ConfigStoreUtils.cpp')
-rw-r--r-- | configstore/utils/ConfigStoreUtils.cpp | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/configstore/utils/ConfigStoreUtils.cpp b/configstore/utils/ConfigStoreUtils.cpp new file mode 100644 index 0000000000..5a1fb42e27 --- /dev/null +++ b/configstore/utils/ConfigStoreUtils.cpp @@ -0,0 +1,40 @@ +// +// 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 |