Add some more debug logging

Signed-off-by: Christopher Collins <ccollins@apache.org>
diff --git a/boot/bootutil/src/bootutil_misc.c b/boot/bootutil/src/bootutil_misc.c
index 1a72699..0debf18 100644
--- a/boot/bootutil/src/bootutil_misc.c
+++ b/boot/bootutil/src/bootutil_misc.c
@@ -394,6 +394,8 @@
 
     off = boot_magic_off(fap);
 
+    BOOT_LOG_DBG("writing magic; fa_id=%d off=0x%x (0x%x)",
+                 fap->fa_id, off, fap->fa_off + off);
     rc = flash_area_write(fap, off, boot_img_magic, BOOT_MAGIC_SZ);
     if (rc != 0) {
         return BOOT_EFLASH;
@@ -414,9 +416,13 @@
     switch (flag) {
     case BOOT_FLAG_COPY_DONE:
         off = boot_copy_done_off(fap);
+        BOOT_LOG_DBG("writing copy_done; fa_id=%d off=0x%x (0x%x)",
+                     fap->fa_id, off, fap->fa_off + off);
         break;
     case BOOT_FLAG_IMAGE_OK:
         off = boot_image_ok_off(fap);
+        BOOT_LOG_DBG("writing image_ok; fa_id=%d off=0x%x (0x%x)",
+                     fap->fa_id, off, fap->fa_off + off);
         break;
     default:
         return BOOT_EBADARGS;
@@ -467,6 +473,9 @@
     memset(buf, erased_val, BOOT_MAX_ALIGN);
     memcpy(buf, (uint8_t *)&swap_size, sizeof swap_size);
 
+    BOOT_LOG_DBG("writing swap_size; fa_id=%d off=0x%x (0x%x)",
+                 fap->fa_id, off, fap->fa_off + off);
+
     rc = flash_area_write(fap, off, buf, align);
     if (rc != 0) {
         return BOOT_EFLASH;
diff --git a/boot/bootutil/src/loader.c b/boot/bootutil/src/loader.c
index c784c31..1240e23 100644
--- a/boot/bootutil/src/loader.c
+++ b/boot/bootutil/src/loader.c
@@ -975,6 +975,8 @@
     struct boot_swap_state swap_state;
     int rc;
 
+    BOOT_LOG_DBG("initializing status; fa_id=%d", fap->fa_id);
+
     rc = boot_read_swap_state_by_id(FLASH_AREA_IMAGE_SECONDARY, &swap_state);
     assert(rc == 0);
 
@@ -1013,6 +1015,8 @@
     uint32_t sz;
     int rc;
 
+    BOOT_LOG_DBG("erasing trailer; fa_id=%d", fap->fa_id);
+
     switch (fap->fa_id) {
     case FLASH_AREA_IMAGE_PRIMARY:
         slot = BOOT_PRIMARY_SLOT;
@@ -1101,6 +1105,7 @@
     assert (rc == 0);
 
     if (bs->state == BOOT_STATUS_STATE_0) {
+        BOOT_LOG_DBG("erasing scratch area");
         rc = boot_erase_sector(fap_scratch, 0, sz);
         assert(rc == 0);
 
@@ -1289,6 +1294,7 @@
      * image is written without a trailer as is the case when using newt, the
      * trailer that was left might trigger a new upgrade.
      */
+    BOOT_LOG_DBG("erasing secondary header");
     rc = boot_erase_sector(fap_secondary_slot,
                            boot_img_sector_off(&boot_data,
                                    BOOT_SECONDARY_SLOT, 0),
@@ -1296,6 +1302,7 @@
                                    BOOT_SECONDARY_SLOT, 0));
     assert(rc == 0);
     last_sector = boot_img_num_sectors(&boot_data, BOOT_SECONDARY_SLOT) - 1;
+    BOOT_LOG_DBG("erasing secondary trailer");
     rc = boot_erase_sector(fap_secondary_slot,
                            boot_img_sector_off(&boot_data,
                                    BOOT_SECONDARY_SLOT, last_sector),
@@ -1481,7 +1488,8 @@
 
 #ifdef MCUBOOT_VALIDATE_PRIMARY_SLOT
     if (boot_status_fails > 0) {
-        BOOT_LOG_WRN("%d status write fails performing the swap", boot_status_fails);
+        BOOT_LOG_WRN("%d status write fails performing the swap",
+                     boot_status_fails);
     }
 #endif