diff options
Diffstat (limited to 'include/vm_websocket.hpp')
-rw-r--r-- | include/vm_websocket.hpp | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/include/vm_websocket.hpp b/include/vm_websocket.hpp index 1e1b7e13d1..1b06a93db8 100644 --- a/include/vm_websocket.hpp +++ b/include/vm_websocket.hpp @@ -46,7 +46,7 @@ class Handler : public std::enable_shared_from_this<Handler> int rc = kill(proxy.id(), SIGTERM); if (rc != 0) { - BMCWEB_LOG_ERROR << "Failed to terminate nbd-proxy: " << errno; + BMCWEB_LOG_ERROR("Failed to terminate nbd-proxy: {}", errno); return; } @@ -61,8 +61,7 @@ class Handler : public std::enable_shared_from_this<Handler> boost::process::std_in < pipeIn, ec); if (ec) { - BMCWEB_LOG_ERROR << "Couldn't connect to nbd-proxy: " - << ec.message(); + BMCWEB_LOG_ERROR("Couldn't connect to nbd-proxy: {}", ec.message()); if (session != nullptr) { session->close("Error connecting to nbd-proxy"); @@ -77,13 +76,13 @@ class Handler : public std::enable_shared_from_this<Handler> { if (doingWrite) { - BMCWEB_LOG_DEBUG << "Already writing. Bailing out"; + BMCWEB_LOG_DEBUG("Already writing. Bailing out"); return; } if (inputBuffer->size() == 0) { - BMCWEB_LOG_DEBUG << "inputBuffer empty. Bailing out"; + BMCWEB_LOG_DEBUG("inputBuffer empty. Bailing out"); return; } @@ -92,7 +91,7 @@ class Handler : public std::enable_shared_from_this<Handler> inputBuffer->data(), [this, self(shared_from_this())](const boost::beast::error_code& ec, std::size_t bytesWritten) { - BMCWEB_LOG_DEBUG << "Wrote " << bytesWritten << "bytes"; + BMCWEB_LOG_DEBUG("Wrote {}bytes", bytesWritten); doingWrite = false; inputBuffer->consume(bytesWritten); @@ -108,7 +107,7 @@ class Handler : public std::enable_shared_from_this<Handler> if (ec) { session->close("Error in writing to proxy port"); - BMCWEB_LOG_ERROR << "Error in VM socket write " << ec; + BMCWEB_LOG_ERROR("Error in VM socket write {}", ec); return; } doWrite(); @@ -123,10 +122,10 @@ class Handler : public std::enable_shared_from_this<Handler> outputBuffer->prepare(bytes), [this, self(shared_from_this())]( const boost::system::error_code& ec, std::size_t bytesRead) { - BMCWEB_LOG_DEBUG << "Read done. Read " << bytesRead << " bytes"; + BMCWEB_LOG_DEBUG("Read done. Read {} bytes", bytesRead); if (ec) { - BMCWEB_LOG_ERROR << "Couldn't read from VM port: " << ec; + BMCWEB_LOG_ERROR("Couldn't read from VM port: {}", ec); if (session != nullptr) { session->close("Error in connecting to VM port"); @@ -170,7 +169,7 @@ inline void requestRoutes(App& app) .privileges({{"ConfigureComponents", "ConfigureManager"}}) .websocket() .onopen([](crow::websocket::Connection& conn) { - BMCWEB_LOG_DEBUG << "Connection " << &conn << " opened"; + BMCWEB_LOG_DEBUG("Connection {} opened", logPtr(&conn)); if (session != nullptr) { @@ -210,8 +209,8 @@ inline void requestRoutes(App& app) if (data.length() > handler->inputBuffer->capacity() - handler->inputBuffer->size()) { - BMCWEB_LOG_ERROR << "Buffer overrun when writing " - << data.length() << " bytes"; + BMCWEB_LOG_ERROR("Buffer overrun when writing {} bytes", + data.length()); conn.close("Buffer overrun"); return; } |