mirror of
https://fuchsia.googlesource.com/third_party/pigweed.googlesource.com/pigweed/pigweed
synced 2024-09-20 05:41:06 +00:00
pw_kvs::flash: Update logs for flash operations
Update flash-related log messages to use the PW_LOG_MODULE_NAME of "PW_FLASH" instead of "KVS". Update the error log in FlashPartition::CheckBounds() to be more clear what the error is. Change-Id: If35a914162a45aaec1fd029dc4ec09bc05c5ea37 Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/65340 Reviewed-by: Ewout van Bekkum <ewout@google.com> Commit-Queue: David Rogers <davidrogers@google.com>
This commit is contained in:
parent
e4dd0d71f0
commit
eb05d88e81
|
@ -12,7 +12,7 @@
|
|||
// License for the specific language governing permissions and limitations under
|
||||
// the License.
|
||||
|
||||
#define PW_LOG_MODULE_NAME "KVS"
|
||||
#define PW_LOG_MODULE_NAME "PW_FLASH"
|
||||
#define PW_LOG_LEVEL PW_KVS_LOG_LEVEL
|
||||
|
||||
#include "pw_kvs/fake_flash_memory.h"
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
// License for the specific language governing permissions and limitations under
|
||||
// the License.
|
||||
|
||||
#define PW_LOG_MODULE_NAME "KVS"
|
||||
#define PW_LOG_MODULE_NAME "PW_FLASH"
|
||||
#define PW_LOG_LEVEL PW_KVS_LOG_LEVEL
|
||||
|
||||
#include "pw_kvs/flash_memory.h"
|
||||
|
@ -150,9 +150,11 @@ bool FlashPartition::AppearsErased(std::span<const byte> data) const {
|
|||
Status FlashPartition::CheckBounds(Address address, size_t length) const {
|
||||
if (address + length > size_bytes()) {
|
||||
PW_LOG_ERROR(
|
||||
"Attempted out-of-bound flash memory access (address: %u length: %u)",
|
||||
"FlashPartition - Attempted access (address: %u length: %u), exceeds "
|
||||
"partition size %u bytes",
|
||||
unsigned(address),
|
||||
unsigned(length));
|
||||
unsigned(length),
|
||||
unsigned(size_bytes()));
|
||||
return Status::OutOfRange();
|
||||
}
|
||||
return OkStatus();
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
// License for the specific language governing permissions and limitations under
|
||||
// the License.
|
||||
|
||||
#define PW_LOG_MODULE_NAME "KVS"
|
||||
#define PW_LOG_MODULE_NAME "PW_FLASH"
|
||||
#define PW_LOG_LEVEL PW_KVS_LOG_LEVEL
|
||||
|
||||
#include "pw_kvs/flash_partition_with_stats.h"
|
||||
|
|
Loading…
Reference in New Issue
Block a user