RootCanal: Convert remaining logs to fmtlib

Forbid the use of LOG_* macros in favor
of DEBUG, INFO, WARNING, ERROR, FATAL.
LOG_* are kept in os/log.h for the packet runtime.

Bug: 284355200
Test: m root-canal
Change-Id: I906ec7bda9547065f2976dbb70532250a434378f
diff --git a/tools/rootcanal/desktop/root_canal_main.cc b/tools/rootcanal/desktop/root_canal_main.cc
index a06da0c..20be4b9 100644
--- a/tools/rootcanal/desktop/root_canal_main.cc
+++ b/tools/rootcanal/desktop/root_canal_main.cc
@@ -82,7 +82,7 @@
   }
   ERROR("Backtrace:");
   for (const auto& frame : data.frames) {
-    ERROR("{}", unwinder.FormatFrame(frame).c_str());
+    ERROR("{}", unwinder.FormatFrame(frame));
   }
   return true;
 }
diff --git a/tools/rootcanal/include/log.h b/tools/rootcanal/include/log.h
index 51f60ed..a9482a9 100644
--- a/tools/rootcanal/include/log.h
+++ b/tools/rootcanal/include/log.h
@@ -69,20 +69,6 @@
   rootcanal::log::Log(rootcanal::log::Verbosity::kFatal, __FILE__, __LINE__, \
                       __VA_ARGS__)
 
-// TODO: still required by the generated HCI parser and serializer backend.
-#define LOG_INFO(...)                                                       \
-  rootcanal::log::Log(rootcanal::log::Verbosity::kInfo, __FILE__, __LINE__, \
-                      "{}", fmt::sprintf(__VA_ARGS__))
-#define LOG_WARN(...)                                                          \
-  rootcanal::log::Log(rootcanal::log::Verbosity::kWarning, __FILE__, __LINE__, \
-                      "{}", fmt::sprintf(__VA_ARGS__))
-#define LOG_ERROR(...)                                                       \
-  rootcanal::log::Log(rootcanal::log::Verbosity::kError, __FILE__, __LINE__, \
-                      "{}", fmt::sprintf(__VA_ARGS__))
-#define LOG_ALWAYS_FATAL(...)                                                \
-  rootcanal::log::Log(rootcanal::log::Verbosity::kFatal, __FILE__, __LINE__, \
-                      "{}", fmt::sprintf(__VA_ARGS__))
-
 #define ASSERT(x)                                                       \
   __builtin_expect((x) != 0, true) ||                                   \
       (rootcanal::log::Log(rootcanal::log::Verbosity::kFatal, __FILE__, \
diff --git a/tools/rootcanal/include/os/log.h b/tools/rootcanal/include/os/log.h
index 2fbb070..a1e46dd 100644
--- a/tools/rootcanal/include/os/log.h
+++ b/tools/rootcanal/include/os/log.h
@@ -18,3 +18,16 @@
 // FIXME: Change hci_packets.h to not depend on os/log.h
 //        and remove this.
 #include "include/log.h"
+
+#define LOG_INFO(...)                                                       \
+  rootcanal::log::Log(rootcanal::log::Verbosity::kInfo, __FILE__, __LINE__, \
+                      "{}", fmt::sprintf(__VA_ARGS__))
+#define LOG_WARN(...)                                                          \
+  rootcanal::log::Log(rootcanal::log::Verbosity::kWarning, __FILE__, __LINE__, \
+                      "{}", fmt::sprintf(__VA_ARGS__))
+#define LOG_ERROR(...)                                                       \
+  rootcanal::log::Log(rootcanal::log::Verbosity::kError, __FILE__, __LINE__, \
+                      "{}", fmt::sprintf(__VA_ARGS__))
+#define LOG_ALWAYS_FATAL(...)                                                \
+  rootcanal::log::Log(rootcanal::log::Verbosity::kFatal, __FILE__, __LINE__, \
+                      "{}", fmt::sprintf(__VA_ARGS__))
diff --git a/tools/rootcanal/model/controller/acl_connection_handler.cc b/tools/rootcanal/model/controller/acl_connection_handler.cc
index bd18296..755fb3a 100644
--- a/tools/rootcanal/model/controller/acl_connection_handler.cc
+++ b/tools/rootcanal/model/controller/acl_connection_handler.cc
@@ -96,18 +96,17 @@
     auto connection = std::get<AclConnection>(pair);
     if (connection.GetAddress() == peer ||
         connection.GetResolvedAddress() == resolved_peer) {
-      LOG_INFO("%s: %s is already connected", __func__,
-               peer.ToString().c_str());
+      INFO("{}: {} is already connected", __func__, peer);
       if (connection.GetResolvedAddress() == resolved_peer) {
-        LOG_INFO("%s: allowing a second connection with %s", __func__,
-                 resolved_peer.ToString().c_str());
+        INFO("{}: allowing a second connection with {}", __func__,
+             resolved_peer);
       } else {
         return false;
       }
     }
   }
   if (le_connection_pending_) {
-    LOG_INFO("%s: connection already pending", __func__);
+    INFO("{}: connection already pending", __func__);
     return false;
   }
   le_connection_pending_ = true;
diff --git a/tools/rootcanal/model/controller/link_layer_controller.cc b/tools/rootcanal/model/controller/link_layer_controller.cc
index 3a6a89a..04958ce 100644
--- a/tools/rootcanal/model/controller/link_layer_controller.cc
+++ b/tools/rootcanal/model/controller/link_layer_controller.cc
@@ -2055,9 +2055,9 @@
                 std::vector(data, data + len));
 
             if (!controller->connections_.HasHandle(acl_connection_handle)) {
-              LOG_ERROR(
+              ERROR(
                   "Dropping LLCP packet sent for unknown connection handle "
-                  "0x%x",
+                  "0x{:x}",
                   acl_connection_handle);
               return;
             }
@@ -4037,7 +4037,7 @@
   uint16_t acl_connection_handle = connections_.GetHandleOnlyAddress(address);
 
   if (acl_connection_handle == kReservedHandle) {
-    LOG_INFO("Dropping LLCP packet since connection does not exist");
+    INFO(id_, "Dropping LLCP packet since connection does not exist");
     return;
   }
 
@@ -4058,9 +4058,9 @@
 
   if (!link_layer_get_cis_connection_handle(ll_.get(), cig_id, cis_id,
                                             &cis_connection_handle)) {
-    LOG_INFO(
-        "Dropping CIS pdu received on disconnected CIS cig_id=%d, cis_id=%d",
-        cig_id, cis_id);
+    INFO(id_,
+         "Dropping CIS pdu received on disconnected CIS cig_id={}, cis_id={}",
+         cig_id, cis_id);
     return;
   }
 
@@ -4104,10 +4104,10 @@
   // Controller (which is returned using the ISO_Data_Packet_Length return
   // parameter of the LE Read Buffer Size command).
   if (iso_data_load.size() > properties_.iso_data_packet_length) {
-    LOG_ALWAYS_FATAL(
-        "Received ISO HCI packet with ISO_Data_Load_Length (%zu) larger than"
-        " the controller buffer size ISO_Data_Packet_Length (%d)",
-        iso_data_load.size(), properties_.iso_data_packet_length);
+    FATAL(id_,
+          "Received ISO HCI packet with ISO_Data_Load_Length ({}) larger than"
+          " the controller buffer size ISO_Data_Packet_Length ({})",
+          iso_data_load.size(), properties_.iso_data_packet_length);
   }
 
   // The TS_Flag bit shall only be set if the PB_Flag field equals 0b00 or 0b10.
@@ -4115,9 +4115,9 @@
       (pb_flag ==
            bluetooth::hci::IsoPacketBoundaryFlag::CONTINUATION_FRAGMENT ||
        pb_flag == bluetooth::hci::IsoPacketBoundaryFlag::LAST_FRAGMENT)) {
-    LOG_ALWAYS_FATAL(
-        "Received ISO HCI packet with TS_Flag set, but no ISO Header is "
-        "expected");
+    FATAL(id_,
+          "Received ISO HCI packet with TS_Flag set, but no ISO Header is "
+          "expected");
   }
 
   uint8_t cig_id = 0;
@@ -4129,8 +4129,8 @@
   if (!link_layer_get_cis_information(ll_.get(), cis_connection_handle,
                                       &acl_connection_handle, &cig_id, &cis_id,
                                       &max_sdu_length)) {
-    LOG_INFO("Ignoring CIS pdu received on disconnected CIS handle=%d",
-             cis_connection_handle);
+    INFO(id_, "Ignoring CIS pdu received on disconnected CIS handle={}",
+         cis_connection_handle);
     return;
   }
 
@@ -4166,9 +4166,10 @@
     // Validate that the Host stack is not sending ISO SDUs that are larger
     // that what was configured for the CIS.
     if (iso_sdu_.size() > max_sdu_length) {
-      LOG_WARN(
-          "attempted to send an SDU of length %zu that exceeds the configure "
-          "Max_SDU_Length (%u)",
+      WARNING(
+          id_,
+          "attempted to send an SDU of length {} that exceeds the configure "
+          "Max_SDU_Length ({})",
           iso_sdu_.size(), max_sdu_length);
       return;
     }
@@ -5226,7 +5227,7 @@
 
   uint16_t handle = connections_.CreateConnection(addr, GetAddress());
   if (handle == kReservedHandle) {
-    LOG_INFO("CreateConnection failed");
+    INFO(id_, "CreateConnection failed");
     return;
   }
   ASSERT(link_manager_add_link(
diff --git a/tools/rootcanal/model/controller/sco_connection.cc b/tools/rootcanal/model/controller/sco_connection.cc
index 45961a1..827e60d 100644
--- a/tools/rootcanal/model/controller/sco_connection.cc
+++ b/tools/rootcanal/model/controller/sco_connection.cc
@@ -86,7 +86,7 @@
   }
   // Ignore empty bandwidths for now.
   if (transmit_bandwidth == 0 || receive_bandwidth == 0) {
-    LOG_WARN("eSCO transmissions with null bandwidths are not supported");
+    WARNING("eSCO transmissions with null bandwidths are not supported");
     return {};
   }
 
@@ -108,8 +108,8 @@
         continue;
       }
 
-      LOG_INFO("Testing combination %u/%u : %u/%u", tx.length, tx.slots,
-               rx.length, rx.slots);
+      INFO("Testing combination {}/{} : {}/{}", tx.length, tx.slots, rx.length,
+           rx.slots);
 
       unsigned rx_max_interval = (1600 * rx.length) / receive_bandwidth;
 
@@ -119,7 +119,7 @@
       transmission_interval -= transmission_interval % 2;
       transmission_interval = std::min(transmission_interval, 254U);
 
-      LOG_INFO("Transmission interval: %u slots", transmission_interval);
+      INFO("Transmission interval: {} slots", transmission_interval);
 
       // Compute retransmission window.
       unsigned retransmission_window =
@@ -134,7 +134,7 @@
               ? 2 * (rx.slots + tx.slots)
               : 0;
 
-      LOG_INFO("Retransmission window: %u slots", retransmission_window);
+      INFO("Retransmission window: {} slots", retransmission_window);
 
       // Compute transmission window and validate latency.
       unsigned transmission_window =
@@ -149,7 +149,7 @@
       // Compute and validate latency.
       unsigned latency = (transmission_window * 1250) / 2;
 
-      LOG_INFO("Latency: %u us (max %u us)", latency, max_latency * 1000U);
+      INFO("Latency: {} us (max {} us)", latency, max_latency * 1000U);
 
       if (latency > (1000 * max_latency)) {
         // Oops
@@ -162,7 +162,7 @@
           (double)transmission_window / (double)transmission_interval;
 
       if (bandwidth_usage <= best_bandwidth_usage) {
-        LOG_INFO("Valid combination!");
+        INFO("Valid combination!");
 
         uint16_t tx_packet_length =
             (transmit_bandwidth * transmission_interval + 1600 - 1) / 1600;
@@ -194,7 +194,7 @@
           (uint8_t)RetransmissionEffort::OPTIMIZED_FOR_POWER ||
       retransmission_effort ==
           (uint8_t)RetransmissionEffort::OPTIMIZED_FOR_LINK_QUALITY) {
-    LOG_WARN("SCO Retransmission effort must be None or Don't care");
+    WARNING("SCO Retransmission effort must be None or Don't care");
     return {};
   }
 
@@ -212,7 +212,7 @@
     transmission_interval = 2;
     packet_length = 10;
   } else {
-    LOG_WARN("No SCO packet type enabled");
+    WARNING("No SCO packet type enabled");
     return {};
   }
 
@@ -231,25 +231,23 @@
     ScoConnectionParameters const& peer) {
   if (peer.transmit_bandwidth != 0xffff &&
       peer.transmit_bandwidth != parameters_.receive_bandwidth) {
-    LOG_WARN("Transmit bandwidth requirements cannot be met");
+    WARNING("Transmit bandwidth requirements cannot be met");
     return false;
   }
 
   if (state_ == SCO_STATE_SENT_ESCO_CONNECTION_REQUEST &&
       peer.receive_bandwidth != 0xffff &&
       peer.receive_bandwidth != parameters_.transmit_bandwidth) {
-    LOG_WARN("Receive bandwidth requirements cannot be met");
+    WARNING("Receive bandwidth requirements cannot be met");
     return false;
   }
 
   // mask out the air coding format bits before comparison, as per 5.3 Vol
   // 4E 6.12
   if ((peer.voice_setting & ~0x3) != (parameters_.voice_setting & ~0x3)) {
-    LOG_WARN("Voice setting requirements cannot be met");
-    LOG_WARN("Remote voice setting: 0x%04x",
-             static_cast<unsigned>(parameters_.voice_setting));
-    LOG_WARN("Local voice setting: 0x%04x",
-             static_cast<unsigned>(peer.voice_setting));
+    WARNING("Voice setting requirements cannot be met");
+    WARNING("Remote voice setting: 0x{:04x}", parameters_.voice_setting);
+    WARNING("Local voice setting: 0x{:04x}", peer.voice_setting);
     return false;
   }
 
@@ -257,11 +255,9 @@
   packet_type |= (peer.packet_type | parameters_.packet_type) & 0x3c0;
 
   if (packet_type == 0x3c0) {
-    LOG_WARN("Packet type requirements cannot be met");
-    LOG_WARN("Remote packet type: 0x%04x",
-             static_cast<unsigned>(parameters_.packet_type));
-    LOG_WARN("Local packet type: 0x%04x",
-             static_cast<unsigned>(peer.packet_type));
+    WARNING("Packet type requirements cannot be met");
+    WARNING("Remote packet type: 0x{:04x}", parameters_.packet_type);
+    WARNING("Local packet type: 0x{:04x}", peer.packet_type);
     return false;
   }
 
@@ -285,11 +281,11 @@
                  (uint8_t)RetransmissionEffort::NO_RETRANSMISSION ||
              parameters_.retransmission_effort ==
                  (uint8_t)RetransmissionEffort::NO_RETRANSMISSION) {
-    LOG_WARN("Retransmission effort requirements cannot be met");
-    LOG_WARN("Remote retransmission effort: 0x%02x",
-             static_cast<unsigned>(parameters_.retransmission_effort));
-    LOG_WARN("Local retransmission effort: 0x%04x",
-             static_cast<unsigned>(peer.retransmission_effort));
+    WARNING("Retransmission effort requirements cannot be met");
+    WARNING("Remote retransmission effort: 0x{:02x}",
+            parameters_.retransmission_effort);
+    WARNING("Local retransmission effort: 0x{:02x}",
+            peer.retransmission_effort);
     return false;
   } else {
     retransmission_effort = (uint8_t)RetransmissionEffort::OPTIMIZED_FOR_POWER;
@@ -306,19 +302,16 @@
   auto link_parameters = negotiated_parameters.GetLinkParameters();
   if (link_parameters.has_value()) {
     link_parameters_ = link_parameters.value();
-    LOG_INFO("Negotiated link parameters for SCO connection:");
-    LOG_INFO("  Transmission interval: %u slots",
-             static_cast<unsigned>(link_parameters_.transmission_interval));
-    LOG_INFO("  Retransmission window: %u slots",
-             static_cast<unsigned>(link_parameters_.retransmission_window));
-    LOG_INFO("  RX packet length: %u bytes",
-             static_cast<unsigned>(link_parameters_.rx_packet_length));
-    LOG_INFO("  TX packet length: %u bytes",
-             static_cast<unsigned>(link_parameters_.tx_packet_length));
-    LOG_INFO("  Air mode: %u",
-             static_cast<unsigned>(link_parameters_.air_mode));
+    INFO("Negotiated link parameters for SCO connection:");
+    INFO("  Transmission interval: {} slots",
+         link_parameters_.transmission_interval);
+    INFO("  Retransmission window: {} slots",
+         link_parameters_.retransmission_window);
+    INFO("  RX packet length: {} bytes", link_parameters_.rx_packet_length);
+    INFO("  TX packet length: {} bytes", link_parameters_.tx_packet_length);
+    INFO("  Air mode: {}", link_parameters_.air_mode);
   } else {
-    LOG_WARN("Failed to derive link parameters");
+    WARNING("Failed to derive link parameters");
   }
   return link_parameters.has_value();
 }
diff --git a/tools/rootcanal/model/devices/hci_device.cc b/tools/rootcanal/model/devices/hci_device.cc
index 9774082..ef2abac 100644
--- a/tools/rootcanal/model/devices/hci_device.cc
+++ b/tools/rootcanal/model/devices/hci_device.cc
@@ -80,7 +80,7 @@
         HandleIso(iso);
       },
       [this]() {
-        LOG_INFO("HCI transport closed");
+        INFO("HCI transport closed");
         Close();
       });
 }
diff --git a/tools/rootcanal/model/devices/link_layer_socket_device.cc b/tools/rootcanal/model/devices/link_layer_socket_device.cc
index 404b359..9936318 100644
--- a/tools/rootcanal/model/devices/link_layer_socket_device.cc
+++ b/tools/rootcanal/model/devices/link_layer_socket_device.cc
@@ -18,7 +18,7 @@
 
 #include <type_traits>  // for remove_extent_t
 
-#include "log.h"                  // for ASSERT, LOG_INFO, LOG_ERROR, LOG_WARN
+#include "log.h"
 #include "packet/bit_inserter.h"  // for BitInserter
 #include "packet/iterator.h"      // for Iterator
 #include "packet/packet_view.h"   // for PacketView, kLittleEndian
@@ -46,8 +46,7 @@
         // DEBUG("Nothing available yet...");
         return;
       }
-      LOG_INFO("Closing socket, received: %zd, %s", bytes_received,
-               strerror(errno));
+      INFO("Closing socket, received: {}, {}", bytes_received, strerror(errno));
       Close();
       return;
     }
@@ -71,8 +70,7 @@
       // DEBUG("Nothing available yet...");
       return;
     }
-    LOG_INFO("Closing socket, received: %zd, %s", bytes_received,
-             strerror(errno));
+    INFO("Closing socket, received: {}, {}", bytes_received, strerror(errno));
     Close();
     return;
   }
diff --git a/tools/rootcanal/model/devices/scripted_beacon.cc b/tools/rootcanal/model/devices/scripted_beacon.cc
index 1139944..0175ab3 100644
--- a/tools/rootcanal/model/devices/scripted_beacon.cc
+++ b/tools/rootcanal/model/devices/scripted_beacon.cc
@@ -78,14 +78,14 @@
   scan_response_data_ = {
       0x05 /* Length */, 0x08 /* TYPE_NAME_SHORT */, 'g', 'b', 'e', 'a'};
 
-  LOG_INFO("Scripted_beacon registered %s", registered_ ? "true" : "false");
+  INFO("Scripted_beacon registered {}", registered_);
 
   if (args.size() >= 4) {
     config_file_ = args[2];
     events_file_ = args[3];
     set_state(PlaybackEvent::INITIALIZED);
   } else {
-    LOG_ERROR(
+    ERROR(
         "Initialization failed, need playback and playback events file "
         "arguments");
   }
@@ -97,7 +97,7 @@
 
 static void populate_event(PlaybackEvent* event,
                            PlaybackEvent::PlaybackEventType type) {
-  LOG_INFO("Adding event: %d", type);
+  INFO("Adding event: {}", type);
   event->set_type(type);
   event->set_secs_since_epoch(system_clock::now().time_since_epoch().count());
 }
@@ -111,7 +111,7 @@
     events_ostream_.open(events_file_,
                          std::ios::out | std::ios::binary | std::ios::trunc);
     if (!events_ostream_.is_open()) {
-      LOG_INFO("Events file not opened yet, for event: %d", state);
+      INFO("Events file not opened yet, for event: {}", state);
       return;
     }
   }
@@ -153,13 +153,12 @@
       }
       std::fstream input(config_file_, std::ios::in | std::ios::binary);
       if (!ble_ad_list_.ParseFromIstream(&input)) {
-        LOG_ERROR("Cannot parse playback file %s", config_file_.c_str());
+        ERROR("Cannot parse playback file {}", config_file_);
         set_state(PlaybackEvent::FILE_PARSING_FAILED);
         return;
       }
       set_state(PlaybackEvent::PLAYBACK_STARTED);
-      LOG_INFO("Starting Ble advertisement playback from file: %s",
-               config_file_.c_str());
+      INFO("Starting Ble advertisement playback from file: {}", config_file_);
       next_ad_.ad_time = steady_clock::now();
       get_next_advertisement();
       input.close();
@@ -179,10 +178,10 @@
           if (events_ostream_.is_open()) {
             events_ostream_.close();
           }
-          LOG_INFO(
-              "Completed Ble advertisement playback from file: %s with %d "
+          INFO(
+              "Completed Ble advertisement playback from file: {} with {} "
               "packets",
-              config_file_.c_str(), packet_num_);
+              config_file_, packet_num_);
           break;
         }
       }
diff --git a/tools/rootcanal/model/devices/sniffer.cc b/tools/rootcanal/model/devices/sniffer.cc
index 847e6d6..2a4dffbc4 100644
--- a/tools/rootcanal/model/devices/sniffer.cc
+++ b/tools/rootcanal/model/devices/sniffer.cc
@@ -45,8 +45,8 @@
   }
 
   INFO("{} {} -> {} (Type {})",
-       (match_source ? (match_dest ? "<->" : "<--") : "-->"), source.ToString(),
-       dest.ToString(), model::packets::PacketTypeText(packet_type));
+       (match_source ? (match_dest ? "<->" : "<--") : "-->"), source, dest,
+       model::packets::PacketTypeText(packet_type));
 }
 
 }  // namespace rootcanal
diff --git a/tools/rootcanal/model/hci/h4_data_channel_packetizer.cc b/tools/rootcanal/model/hci/h4_data_channel_packetizer.cc
index 445cc6d..e8f2114 100644
--- a/tools/rootcanal/model/hci/h4_data_channel_packetizer.cc
+++ b/tools/rootcanal/model/hci/h4_data_channel_packetizer.cc
@@ -26,7 +26,7 @@
 #include <utility>      // for move
 #include <vector>       // for vector
 
-#include "log.h"                     // for LOG_ERROR, LOG_ALWAYS_FATAL
+#include "log.h"
 #include "model/hci/h4_parser.h"     // for H4Parser, ClientDisconnectCa...
 #include "net/async_data_channel.h"  // for AsyncDataChannel
 
@@ -45,20 +45,19 @@
                                      size_t length) {
   ssize_t ret = uart_socket_->Send(&type, sizeof(type));
   if (ret == -1) {
-    LOG_ERROR("Error writing to UART (%s)", strerror(errno));
+    ERROR("Error writing to UART ({})", strerror(errno));
   }
   size_t to_be_written = ret;
 
   ret = uart_socket_->Send(data, length);
   if (ret == -1) {
-    LOG_ERROR("Error writing to UART (%s)", strerror(errno));
+    ERROR("Error writing to UART ({})", strerror(errno));
   }
   to_be_written += ret;
 
   if (to_be_written != length + sizeof(type)) {
-    LOG_ERROR("%d / %d bytes written - something went wrong...",
-              static_cast<int>(to_be_written),
-              static_cast<int>(length + sizeof(type)));
+    ERROR("{} / {} bytes written - something went wrong...", to_be_written,
+          length + sizeof(type));
   }
   return to_be_written;
 }
@@ -75,7 +74,7 @@
 
     ssize_t bytes_read = socket->Recv(buffer.data(), bytes_to_read);
     if (bytes_read == 0) {
-      LOG_INFO("remote disconnected!");
+      INFO("remote disconnected!");
       disconnected_ = true;
       disconnect_cb_();
       return;
@@ -91,8 +90,7 @@
         disconnect_cb_();
         return;
       }
-      LOG_ALWAYS_FATAL("Read error in %u: %s", h4_parser_.CurrentState(),
-                       strerror(errno));
+      FATAL("Read error in {}: {}", h4_parser_.CurrentState(), strerror(errno));
     }
     h4_parser_.Consume(buffer.data(), bytes_read);
   }
diff --git a/tools/rootcanal/model/hci/h4_parser.cc b/tools/rootcanal/model/hci/h4_parser.cc
index ba335cb..7715fae 100644
--- a/tools/rootcanal/model/hci/h4_parser.cc
+++ b/tools/rootcanal/model/hci/h4_parser.cc
@@ -23,7 +23,7 @@
 #include <utility>     // for move
 #include <vector>      // for vector
 
-#include "log.h"  // for LOG_ALWAYS_FATAL, LOG_INFO
+#include "log.h"
 
 namespace rootcanal {
 
@@ -85,8 +85,7 @@
       iso_cb_(packet_);
       break;
     default:
-      LOG_ALWAYS_FATAL("Unimplemented packet type %d",
-                       static_cast<int>(hci_packet_type_));
+      FATAL("Unimplemented packet type {}", hci_packet_type_);
   }
   // Get ready for the next type byte.
   hci_packet_type_ = PacketType::UNKNOWN;
@@ -106,13 +105,12 @@
 bool H4Parser::Consume(const uint8_t* buffer, int32_t bytes_read) {
   size_t bytes_to_read = BytesRequested();
   if (bytes_read <= 0) {
-    LOG_INFO("remote disconnected, or unhandled error?");
+    INFO("remote disconnected, or unhandled error?");
     return false;
   }
   if ((uint32_t)bytes_read > BytesRequested()) {
-    LOG_ALWAYS_FATAL("More bytes read (%u) than expected (%u)!",
-                     static_cast<int>(bytes_read),
-                     static_cast<int>(bytes_to_read));
+    FATAL("More bytes read ({}) than expected ({})!", bytes_read,
+          bytes_to_read);
   }
 
   static const size_t preamble_size[static_cast<size_t>(PacketType::ISO) + 1] =
@@ -136,8 +134,7 @@
       // The parser can end up in a bad state when the host is restarted.
       const std::array<uint8_t, 4> reset_command{0x01, 0x03, 0x0c, 0x00};
       size_t offset = packet_.size();
-      LOG_WARN("Received byte in recovery state : 0x%x",
-               static_cast<unsigned>(*buffer));
+      WARNING("Received byte in recovery state : 0x{:x}", *buffer);
       packet_.push_back(*buffer);
 
       // Last byte does not match expected byte in the sequence.
@@ -152,7 +149,7 @@
 
       // Received full reset command.
       if (packet_.size() == reset_command.size()) {
-        LOG_INFO("Received HCI Reset command, exiting recovery state");
+        INFO("Received HCI Reset command, exiting recovery state");
         // Pop the Idc from the received packet.
         packet_.erase(packet_.begin());
         bytes_wanted_ = 0;
@@ -176,11 +173,10 @@
           hci_packet_type_ != PacketType::EVENT &&
           hci_packet_type_ != PacketType::ISO) {
         if (!enable_recovery_state_) {
-          LOG_ALWAYS_FATAL("Received invalid packet type 0x%x",
-                           static_cast<unsigned>(packet_type_));
+          FATAL("Received invalid packet type 0x{:x}", packet_type_);
         }
-        LOG_ERROR("Received invalid packet type 0x%x, entering recovery state",
-                  static_cast<unsigned>(packet_type_));
+        ERROR("Received invalid packet type 0x{:x}, entering recovery state",
+              packet_type_);
         state_ = HCI_RECOVERY;
         hci_packet_type_ = PacketType::COMMAND;
         bytes_wanted_ = 1;
diff --git a/tools/rootcanal/model/hci/hci_socket_transport.cc b/tools/rootcanal/model/hci/hci_socket_transport.cc
index 6a84e75..c018b0e 100644
--- a/tools/rootcanal/model/hci/hci_socket_transport.cc
+++ b/tools/rootcanal/model/hci/hci_socket_transport.cc
@@ -16,7 +16,7 @@
 
 #include "hci_socket_transport.h"
 
-#include "log.h"  // for LOG_INFO, LOG_ALWAYS_FATAL
+#include "log.h"
 
 namespace rootcanal {
 
@@ -37,7 +37,7 @@
         command_callback(packet_copy);
       },
       [](const std::vector<uint8_t>&) {
-        LOG_ALWAYS_FATAL("Unexpected Event in HciSocketTransport!");
+        FATAL("Unexpected Event in HciSocketTransport!");
       },
       [acl_callback](const std::vector<uint8_t>& raw_acl) {
         std::shared_ptr<std::vector<uint8_t>> packet_copy =
@@ -62,8 +62,7 @@
 void HciSocketTransport::SendHci(PacketType packet_type,
                                  const std::vector<uint8_t>& packet) {
   if (!socket_ || !socket_->Connected()) {
-    LOG_INFO("Closed socket. Dropping packet of type %d",
-             static_cast<int>(packet_type));
+    INFO("Closed socket. Dropping packet of type {}", packet_type);
     return;
   }
   uint8_t type = static_cast<uint8_t>(packet_type);
diff --git a/tools/rootcanal/model/setup/async_manager.cc b/tools/rootcanal/model/setup/async_manager.cc
index dd9b1a4..2bbdfba 100644
--- a/tools/rootcanal/model/setup/async_manager.cc
+++ b/tools/rootcanal/model/setup/async_manager.cc
@@ -105,7 +105,7 @@
     // start the thread if not started yet
     int started = tryStartThread();
     if (started != 0) {
-      LOG_ERROR("%s: Unable to start thread", __func__);
+      ERROR("{}: Unable to start thread", __func__);
       return started;
     }
 
@@ -136,8 +136,8 @@
     if (std::this_thread::get_id() != thread_.get_id()) {
       thread_.join();
     } else {
-      LOG_WARN("%s: Starting thread stop from inside the reading thread itself",
-               __func__);
+      WARNING("{}: Starting thread stop from inside the reading thread itself",
+              __func__);
     }
 
     {
@@ -158,8 +158,8 @@
     // set up the communication channel
     int pipe_fds[2];
     if (pipe2(pipe_fds, O_NONBLOCK)) {
-      LOG_ERROR(
-          "%s:Unable to establish a communication channel to the reading "
+      ERROR(
+          "{}: Unable to establish a communication channel to the reading "
           "thread",
           __func__);
       return -1;
@@ -169,7 +169,7 @@
 
     thread_ = std::thread([this]() { ThreadRoutine(); });
     if (!thread_.joinable()) {
-      LOG_ERROR("%s: Unable to start reading thread", __func__);
+      ERROR("{}: Unable to start reading thread", __func__);
       return -1;
     }
     return 0;
@@ -178,7 +178,7 @@
   int notifyThread() const {
     char buffer = '0';
     if (TEMP_FAILURE_RETRY(write(notification_write_fd_, &buffer, 1)) < 0) {
-      LOG_ERROR("%s: Unable to send message to reading thread", __func__);
+      ERROR("{}: Unable to send message to reading thread", __func__);
       return -1;
     }
     return 0;
@@ -236,9 +236,9 @@
       // wait until there is data available to read on some FD
       int retval = select(nfds + 1, &read_fds, NULL, NULL, NULL);
       if (retval <= 0) {  // there was some error or a timeout
-        LOG_ERROR(
-            "%s: There was an error while waiting for data on the file "
-            "descriptors: %s",
+        ERROR(
+            "{}: There was an error while waiting for data on the file "
+            "descriptors: {}",
             __func__, strerror(errno));
         continue;
       }
@@ -329,8 +329,8 @@
     if (std::this_thread::get_id() != thread_.get_id()) {
       thread_.join();
     } else {
-      LOG_WARN("%s: Starting thread stop from inside the task thread itself",
-               __func__);
+      WARNING("{}: Starting thread stop from inside the task thread itself",
+              __func__);
     }
     return 0;
   }
@@ -425,7 +425,7 @@
     // start thread if necessary
     int started = tryStartThread();
     if (started != 0) {
-      LOG_ERROR("%s: Unable to start thread", __func__);
+      ERROR("{}: Unable to start thread", __func__);
       return kInvalidTaskId;
     }
     // notify the thread so that it knows of the new task
@@ -449,7 +449,7 @@
     running_ = true;
     thread_ = std::thread([this]() { ThreadRoutine(); });
     if (!thread_.joinable()) {
-      LOG_ERROR("%s: Unable to start task thread", __func__);
+      ERROR("{}: Unable to start task thread", __func__);
       return -1;
     }
     return 0;
diff --git a/tools/rootcanal/model/setup/device_boutique.cc b/tools/rootcanal/model/setup/device_boutique.cc
index 0b5a830..ad04cbe 100644
--- a/tools/rootcanal/model/setup/device_boutique.cc
+++ b/tools/rootcanal/model/setup/device_boutique.cc
@@ -36,7 +36,7 @@
     const std::string& device_type,
     const std::function<std::shared_ptr<Device>(const vector<std::string>&)>
         method) {
-  LOG_INFO("Registering %s", device_type.c_str());
+  INFO("Registering {}", device_type);
   GetMap()[device_type] = method;
   return true;
 }
@@ -48,7 +48,7 @@
   auto device = GetMap().find(args[0]);
 
   if (device == GetMap().end()) {
-    LOG_WARN("No constructor registered for %s", args[0].c_str());
+    WARNING("No constructor registered for {}", args[0]);
     return std::shared_ptr<Device>(nullptr);
   }
 
diff --git a/tools/rootcanal/model/setup/phy_device.cc b/tools/rootcanal/model/setup/phy_device.cc
index 1d5bf3a..2571861 100644
--- a/tools/rootcanal/model/setup/phy_device.cc
+++ b/tools/rootcanal/model/setup/phy_device.cc
@@ -50,7 +50,7 @@
   if (packet_view.IsValid()) {
     device_->ReceiveLinkLayerPacket(std::move(packet_view), type, rssi);
   } else {
-    LOG_WARN("received invalid LL packet");
+    WARNING("received invalid LL packet");
   }
 }
 
diff --git a/tools/rootcanal/model/setup/test_channel_transport.cc b/tools/rootcanal/model/setup/test_channel_transport.cc
index a4635e3..6b04326 100644
--- a/tools/rootcanal/model/setup/test_channel_transport.cc
+++ b/tools/rootcanal/model/setup/test_channel_transport.cc
@@ -23,7 +23,7 @@
 #include <cstring>      // for strerror
 #include <type_traits>  // for remove_extent_t
 
-#include "log.h"                     // for LOG_INFO, ASSERT_LOG, LOG_WARN
+#include "log.h"
 #include "net/async_data_channel.h"  // for AsyncDataChannel
 
 using std::vector;
@@ -48,21 +48,21 @@
   uint8_t command_name_size = 0;
   ssize_t bytes_read = socket->Recv(&command_name_size, 1);
   if (bytes_read != 1) {
-    LOG_INFO("Unexpected (command_name_size) bytes_read: %zd != %d, %s",
-             bytes_read, 1, strerror(errno));
+    INFO("Unexpected (command_name_size) bytes_read: {} != {}, {}", bytes_read,
+         1, strerror(errno));
     socket->Close();
   }
   vector<uint8_t> command_name_raw;
   command_name_raw.resize(command_name_size);
   bytes_read = socket->Recv(command_name_raw.data(), command_name_size);
   if (bytes_read != command_name_size) {
-    LOG_INFO("Unexpected (command_name) bytes_read: %zd != %d, %s", bytes_read,
-             command_name_size, strerror(errno));
+    INFO("Unexpected (command_name) bytes_read: {} != {}, {}", bytes_read,
+         command_name_size, strerror(errno));
   }
   std::string command_name(command_name_raw.begin(), command_name_raw.end());
 
   if (command_name == "CLOSE_TEST_CHANNEL" || command_name.empty()) {
-    LOG_INFO("Test channel closed");
+    INFO("Test channel closed");
     unwatch();
     socket->Close();
     return;
@@ -71,23 +71,23 @@
   uint8_t num_args = 0;
   bytes_read = socket->Recv(&num_args, 1);
   if (bytes_read != 1) {
-    LOG_INFO("Unexpected (num_args) bytes_read: %zd != %d, %s", bytes_read, 1,
-             strerror(errno));
+    INFO("Unexpected (num_args) bytes_read: {} != {}, {}", bytes_read, 1,
+         strerror(errno));
   }
   vector<std::string> args;
   for (uint8_t i = 0; i < num_args; ++i) {
     uint8_t arg_size = 0;
     bytes_read = socket->Recv(&arg_size, 1);
     if (bytes_read != 1) {
-      LOG_INFO("Unexpected (arg_size) bytes_read: %zd != %d, %s", bytes_read, 1,
-               strerror(errno));
+      INFO("Unexpected (arg_size) bytes_read: {} != {}, {}", bytes_read, 1,
+           strerror(errno));
     }
     vector<uint8_t> arg;
     arg.resize(arg_size);
     bytes_read = socket->Recv(arg.data(), arg_size);
     if (bytes_read != arg_size) {
-      LOG_INFO("Unexpected (arg) bytes_read: %zd != %d, %s", bytes_read,
-               arg_size, strerror(errno));
+      INFO("Unexpected (arg) bytes_read: {} != {}, {}", bytes_read, arg_size,
+           strerror(errno));
     }
     args.push_back(std::string(arg.begin(), arg.end()));
   }
@@ -108,7 +108,7 @@
                          static_cast<uint8_t>((size >> 24) & 0xff)};
   ssize_t written = socket->Send(size_buf, 4);
   if (written == -1 && errno == EBADF) {
-    LOG_WARN("Unable to send a response.  EBADF");
+    WARNING("Unable to send a response.  EBADF");
     return;
   }
   ASSERT_LOG(written == 4, "What happened? written = %zd errno = %d", written,
diff --git a/tools/rootcanal/model/setup/test_command_handler.cc b/tools/rootcanal/model/setup/test_command_handler.cc
index b0eaa5f..3225b53 100644
--- a/tools/rootcanal/model/setup/test_command_handler.cc
+++ b/tools/rootcanal/model/setup/test_command_handler.cc
@@ -106,11 +106,11 @@
   if (new_dev == NULL) {
     response_string_ = "TestCommandHandler 'add' " + args[0] + " failed!";
     send_response_(response_string_);
-    LOG_WARN("%s", response_string_.c_str());
+    WARNING("{}", response_string_);
     return;
   }
 
-  LOG_INFO("Add %s", new_dev->ToString().c_str());
+  INFO("Add {}", new_dev->ToString());
   size_t dev_index = model_.AddDevice(new_dev);
   response_string_ =
       std::to_string(dev_index) + std::string(":") + new_dev->ToString();
@@ -213,7 +213,7 @@
 
 void TestCommandHandler::List(const vector<std::string>& args) {
   if (!args.empty()) {
-    LOG_INFO("Unused args: arg[0] = %s", args[0].c_str());
+    INFO("Unused args: arg[0] = {}", args[0]);
     return;
   }
   send_response_(model_.List());
@@ -238,7 +238,7 @@
 
 void TestCommandHandler::SetTimerPeriod(const vector<std::string>& args) {
   if (args.size() != 1) {
-    LOG_INFO("SetTimerPeriod takes 1 argument");
+    INFO("SetTimerPeriod takes 1 argument");
   }
   size_t period = std::stoi(args[0]);
   if (period != 0) {
@@ -254,7 +254,7 @@
 
 void TestCommandHandler::StartTimer(const vector<std::string>& args) {
   if (!args.empty()) {
-    LOG_INFO("Unused args: arg[0] = %s", args[0].c_str());
+    INFO("Unused args: arg[0] = {}", args[0]);
   }
   model_.StartTimer();
   response_string_ = "timer started";
@@ -263,7 +263,7 @@
 
 void TestCommandHandler::StopTimer(const vector<std::string>& args) {
   if (!args.empty()) {
-    LOG_INFO("Unused args: arg[0] = %s", args[0].c_str());
+    INFO("Unused args: arg[0] = {}", args[0]);
   }
   model_.StopTimer();
   response_string_ = "timer stopped";
@@ -272,7 +272,7 @@
 
 void TestCommandHandler::Reset(const std::vector<std::string>& args) {
   if (!args.empty()) {
-    LOG_INFO("Unused args: arg[0] = %s", args[0].c_str());
+    INFO("Unused args: arg[0] = {}", args[0]);
   }
   model_.Reset();
   response_string_ = "model reset";
diff --git a/tools/rootcanal/model/setup/test_model.cc b/tools/rootcanal/model/setup/test_model.cc
index bca03af..b80fde6 100644
--- a/tools/rootcanal/model/setup/test_model.cc
+++ b/tools/rootcanal/model/setup/test_model.cc
@@ -26,7 +26,7 @@
 #include <utility>      // for move
 
 #include "include/phy.h"  // for Phy, Phy::Type
-#include "log.h"          // for LOG_WARN, LOG_INFO
+#include "log.h"
 #include "phy_layer.h"
 
 namespace rootcanal {
@@ -73,14 +73,14 @@
 }
 
 void TestModel::StartTimer() {
-  LOG_INFO("StartTimer()");
+  INFO("StartTimer()");
   timer_tick_task_ =
       schedule_periodic_task_(model_user_id_, std::chrono::milliseconds(0),
                               timer_period_, [this]() { TestModel::Tick(); });
 }
 
 void TestModel::StopTimer() {
-  LOG_INFO("StopTimer()");
+  INFO("StopTimer()");
   cancel_task_(timer_tick_task_);
   timer_tick_task_ = kInvalidTaskId;
 }
@@ -166,8 +166,8 @@
 
 void TestModel::AddLinkLayerConnection(std::shared_ptr<Device> device,
                                        Phy::Type type) {
-  LOG_INFO("Adding a new link layer connection of type: %s",
-           type == Phy::Type::BR_EDR ? "BR_EDR" : "LOW_ENERGY");
+  INFO("Adding a new link layer connection of type: {}",
+       type == Phy::Type::BR_EDR ? "BR_EDR" : "LOW_ENERGY");
 
   PhyDevice::Identifier device_id = AddDevice(device);
 
@@ -208,8 +208,7 @@
   }};
   device->SetAddress(bluetooth_address);
 
-  LOG_INFO("Initialized device with address %s",
-           bluetooth_address.ToString().c_str());
+  INFO("Initialized device with address {}", bluetooth_address.ToString());
 
   for (auto& [_, phy_layer] : phy_layers_) {
     phy_layer->Register(phy_devices_[device_id]);
@@ -268,7 +267,7 @@
 void TestModel::Reset() {
   StopTimer();
   schedule_task_(model_user_id_, std::chrono::milliseconds(0), [this]() {
-    LOG_INFO("Running Reset task");
+    INFO("Running Reset task");
     for (auto& [_, phy_layer] : phy_layers_) {
       phy_layer->UnregisterAll();
     }
diff --git a/tools/rootcanal/net/posix/posix_async_socket.cc b/tools/rootcanal/net/posix/posix_async_socket.cc
index 37f948f..d6c982e 100644
--- a/tools/rootcanal/net/posix/posix_async_socket.cc
+++ b/tools/rootcanal/net/posix/posix_async_socket.cc
@@ -21,7 +21,7 @@
 
 #include <functional>  // for __base
 
-#include "log.h"                        // for LOG_INFO
+#include "log.h"
 #include "model/setup/async_manager.h"  // for AsyncManager
 
 #ifdef _WIN32
@@ -32,7 +32,7 @@
 #ifdef NDEBUG
 #define DD(...) (void)0
 #else
-#define DD(...) LOG_INFO(__VA_ARGS__)
+#define DD(...) INFO(__VA_ARGS__)
 #endif
 
 namespace android {
@@ -76,9 +76,9 @@
   REPEAT_UNTIL_NO_INTR(res = read(fd_, buffer, bufferSize));
 
   if (res < 0) {
-    DD("Recv < 0: %s (%d)", strerror(errno), fd_);
+    DD("Recv < 0: {} ({})", strerror(errno), fd_);
   }
-  DD("%zd bytes (%d)", res, fd_);
+  DD("{} bytes ({})", res, fd_);
   return res;
 };
 
@@ -97,7 +97,7 @@
 
   REPEAT_UNTIL_NO_INTR(res = send(fd_, buffer, bufferSize, sendFlags));
 
-  DD("%zd bytes (%d)", res, fd_);
+  DD("{} bytes ({})", res, fd_);
   return res;
 }
 
@@ -107,7 +107,7 @@
   }
   char buf;
   if (recv(fd_, &buf, 1, MSG_PEEK | MSG_DONTWAIT) != 1) {
-    DD("Recv not 1, could be connected: %s (%d)", strerror(errno), fd_);
+    DD("Recv not 1, could be connected: {} ({})", strerror(errno), fd_);
     return errno == EAGAIN || errno == EWOULDBLOCK;
   }
 
@@ -133,9 +133,9 @@
 
   error_code = ::close(fd_);
   if (error_code == -1) {
-    LOG_INFO("Failed to close: %s (%d)", strerror(errno), fd_);
+    INFO("Failed to close: {} ({})", strerror(errno), fd_);
   }
-  LOG_INFO("(%d)", fd_);
+  INFO("({})", fd_);
   fd_ = -1;
 }
 
diff --git a/tools/rootcanal/net/posix/posix_async_socket_connector.cc b/tools/rootcanal/net/posix/posix_async_socket_connector.cc
index dbb58b7..ed02bc1 100644
--- a/tools/rootcanal/net/posix/posix_async_socket_connector.cc
+++ b/tools/rootcanal/net/posix/posix_async_socket_connector.cc
@@ -24,7 +24,7 @@
 
 #include <type_traits>  // for remove_extent_t
 
-#include "log.h"                           // for LOG_INFO
+#include "log.h"
 #include "net/posix/posix_async_socket.h"  // for PosixAsyncSocket
 
 namespace android {
@@ -37,22 +37,20 @@
 PosixAsyncSocketConnector::ConnectToRemoteServer(
     const std::string& server, int port,
     const std::chrono::milliseconds timeout) {
-  LOG_INFO("Connecting to %s:%d in %d ms", server.c_str(), port,
-           (int)timeout.count());
+  INFO("Connecting to {}:{} in {} ms", server, port, timeout.count());
   int socket_fd = socket(AF_INET, SOCK_STREAM, 0);
   std::shared_ptr<PosixAsyncSocket> pas =
       std::make_shared<PosixAsyncSocket>(socket_fd, am_);
 
   if (socket_fd < 1) {
-    LOG_INFO("socket() call failed: %s", strerror(errno));
+    INFO("socket() call failed: {}", strerror(errno));
     return pas;
   }
 
   struct hostent* host;
   host = gethostbyname(server.c_str());
   if (host == NULL) {
-    LOG_INFO("gethostbyname() failed for %s: %s", server.c_str(),
-             strerror(errno));
+    INFO("gethostbyname() failed for {}: {}", server, strerror(errno));
     pas->Close();
     return pas;
   }
@@ -68,8 +66,8 @@
 
   if (result != 0 && errno != EWOULDBLOCK && errno != EAGAIN &&
       errno != EINPROGRESS) {
-    LOG_INFO("Failed to connect to %s:%d, error:  %s", server.c_str(), port,
-             strerror(errno));
+    INFO("Failed to connect to {}:{}, error: {}", server, port,
+         strerror(errno));
     pas->Close();
     return pas;
   }
@@ -87,8 +85,8 @@
   REPEAT_UNTIL_NO_INTR(numFdsReady = ::poll(fds, 1, timeout.count()));
 
   if (numFdsReady <= 0) {
-    LOG_INFO("Failed to connect to %s:%d, error:  %s", server.c_str(), port,
-             strerror(errno));
+    INFO("Failed to connect to {}:{}, error: {}", server, port,
+         strerror(errno));
     pas->Close();
     return pas;
   }
@@ -99,8 +97,8 @@
   socklen_t sslen = sizeof(ss);
 
   if (getpeername(socket_fd, (struct sockaddr*)&ss, &sslen) < 0) {
-    LOG_INFO("Failed to connect to %s:%d, error:  %s", server.c_str(), port,
-             strerror(errno));
+    INFO("Failed to connect to {}:{}, error: {}", server, port,
+         strerror(errno));
     pas->Close();
     return pas;
   }
@@ -112,13 +110,12 @@
       err) {
     // Either getsockopt failed or there was an error associated
     // with the socket. The connection did not succeed.
-    LOG_INFO("Failed to connect to %s:%d, error:  %s", server.c_str(), port,
-             strerror(err));
+    INFO("Failed to connect to {}:{}, error:  {}", server, port, strerror(err));
     pas->Close();
     return pas;
   }
 
-  LOG_INFO("Connected to %s:%d (%d)", server.c_str(), port, socket_fd);
+  INFO("Connected to {}:{} ({})", server, port, socket_fd);
   return pas;
 }
 
diff --git a/tools/rootcanal/net/posix/posix_async_socket_server.cc b/tools/rootcanal/net/posix/posix_async_socket_server.cc
index 1b54dc4..185f17d 100644
--- a/tools/rootcanal/net/posix/posix_async_socket_server.cc
+++ b/tools/rootcanal/net/posix/posix_async_socket_server.cc
@@ -23,7 +23,7 @@
 #include <functional>   // for __base, function
 #include <type_traits>  // for remove_extent_t
 
-#include "log.h"                           // for LOG_INFO, LOG_ERROR
+#include "log.h"
 #include "net/posix/posix_async_socket.h"  // for PosixAsyncSocket, AsyncMan...
 
 namespace android {
@@ -41,14 +41,14 @@
   } while (listen_fd == -1 && errno == EAGAIN);
 
   if (listen_fd < 0) {
-    LOG_INFO("Error creating socket for test channel.");
+    INFO("Error creating socket for test channel.");
     return;
   }
 
   int enable = 1;
   if (setsockopt(listen_fd, SOL_SOCKET, SO_REUSEADDR, &enable, sizeof(int)) <
       0) {
-    LOG_ERROR("setsockopt(SO_REUSEADDR) failed: %s", strerror(errno));
+    ERROR("setsockopt(SO_REUSEADDR) failed: {}", strerror(errno));
   }
 
   listen_address.sin_family = AF_INET;
@@ -57,14 +57,14 @@
 
   if (bind(listen_fd, reinterpret_cast<sockaddr*>(&listen_address),
            sockaddr_in_size) < 0) {
-    LOG_INFO("Error binding test channel listener socket to port: %d, %s", port,
-             strerror(errno));
+    INFO("Error binding test channel listener socket to port: {}, {}", port,
+         strerror(errno));
     close(listen_fd);
     return;
   }
 
   if (listen(listen_fd, 1) < 0) {
-    LOG_INFO("Error listening for test channel: %s", strerror(errno));
+    INFO("Error listening for test channel: {}", strerror(errno));
     close(listen_fd);
     return;
   }
@@ -72,11 +72,11 @@
   struct sockaddr_in sin;
   socklen_t slen = sizeof(sin);
   if (getsockname(listen_fd, (struct sockaddr*)&sin, &slen) == -1) {
-    LOG_INFO("Error retrieving actual port: %s", strerror(errno));
+    INFO("Error retrieving actual port: {}", strerror(errno));
   } else {
     port_ = ntohs(sin.sin_port);
   }
-  LOG_INFO("Listening on: %d (%d)", port_, listen_fd);
+  INFO("Listening on: {} ({})", port_, listen_fd);
   server_socket_ = std::make_shared<PosixAsyncSocket>(listen_fd, am_);
 }
 
@@ -105,12 +105,12 @@
   REPEAT_UNTIL_NO_INTR(accept_fd = accept(server_socket_->fd(), NULL, NULL));
 
   if (accept_fd < 0) {
-    LOG_INFO("Error accepting test channel connection errno=%d (%s).", errno,
-             strerror(errno));
+    INFO("Error accepting test channel connection errno={} ({}).", errno,
+         strerror(errno));
     return;
   }
 
-  LOG_INFO("accept_fd = %d.", accept_fd);
+  INFO("accept_fd = {}.", accept_fd);
   StopListening();
   callback_(std::make_shared<PosixAsyncSocket>(accept_fd, am_), this);
 }