pvAccessLog() add EPICS_PRINTF_STYLE()
and fixup incorrect specifiers
This commit is contained in:
@ -250,7 +250,7 @@ bool discoverServers(double timeOut)
|
||||
|
||||
for (size_t i = 0; i < broadcastAddresses.size(); i++)
|
||||
LOG(logLevelDebug,
|
||||
"Broadcast address #%d: %s.", i, inetAddressToString(broadcastAddresses[i]).c_str());
|
||||
"Broadcast address #%zu: %s.", i, inetAddressToString(broadcastAddresses[i]).c_str());
|
||||
|
||||
// ---
|
||||
|
||||
|
@ -395,7 +395,7 @@ bool BlockingUDPTransport::send(const char* buffer, size_t length, const osiSock
|
||||
{
|
||||
if (IS_LOGGABLE(logLevelDebug))
|
||||
{
|
||||
LOG(logLevelDebug, "Sending %d bytes to %s.",
|
||||
LOG(logLevelDebug, "Sending %zu bytes to %s.",
|
||||
length, inetAddressToString(address).c_str());
|
||||
}
|
||||
|
||||
@ -419,7 +419,7 @@ bool BlockingUDPTransport::send(ByteBuffer* buffer, const osiSockAddr& address)
|
||||
|
||||
if (IS_LOGGABLE(logLevelDebug))
|
||||
{
|
||||
LOG(logLevelDebug, "Sending %d bytes to %s.",
|
||||
LOG(logLevelDebug, "Sending %zu bytes to %s.",
|
||||
buffer->getRemaining(), inetAddressToString(address).c_str());
|
||||
}
|
||||
|
||||
@ -456,7 +456,7 @@ bool BlockingUDPTransport::send(ByteBuffer* buffer, InetAddressType target) {
|
||||
|
||||
if (IS_LOGGABLE(logLevelDebug))
|
||||
{
|
||||
LOG(logLevelDebug, "Sending %d bytes to %s.",
|
||||
LOG(logLevelDebug, "Sending %zu bytes to %s.",
|
||||
buffer->getRemaining(), inetAddressToString(_sendAddresses[i]).c_str());
|
||||
}
|
||||
|
||||
@ -586,7 +586,7 @@ void initializeUDPTransports(bool serverFlag,
|
||||
if (listenPort == 0)
|
||||
{
|
||||
listenPort = ntohs(sendTransport->getRemoteAddress()->ia.sin_port);
|
||||
LOG(logLevelDebug, "Dynamic listen UDP port set to %d.", listenPort);
|
||||
LOG(logLevelDebug, "Dynamic listen UDP port set to %u.", (unsigned)listenPort);
|
||||
}
|
||||
|
||||
// TODO current implementation shares the port (aka beacon and search port)
|
||||
@ -651,7 +651,7 @@ void initializeUDPTransports(bool serverFlag,
|
||||
else
|
||||
for (size_t i = 0; i < blist.size(); i++)
|
||||
LOG(logLevelDebug,
|
||||
"Broadcast address #%d: %s.", i, inetAddressToString(blist[i]).c_str());
|
||||
"Broadcast address #%zu: %s.", i, inetAddressToString(blist[i]).c_str());
|
||||
|
||||
|
||||
// TODO configurable local NIF, address
|
||||
|
@ -1569,7 +1569,7 @@ void BlockingServerTCPTransportCodec::destroyAllChannels() {
|
||||
{
|
||||
LOG(
|
||||
logLevelDebug,
|
||||
"Transport to %s still has %zd channel(s) active and closing...",
|
||||
"Transport to %s still has %zu channel(s) active and closing...",
|
||||
_socketName.c_str(), _channels.size());
|
||||
}
|
||||
|
||||
@ -1793,7 +1793,7 @@ void BlockingClientTCPTransportCodec::closedNotifyClients() {
|
||||
{
|
||||
LOG(
|
||||
logLevelDebug,
|
||||
"Transport to %s still has %d client(s) active and closing...",
|
||||
"Transport to %s still has %zu client(s) active and closing...",
|
||||
_socketName.c_str(), refs);
|
||||
}
|
||||
|
||||
|
@ -4230,7 +4230,7 @@ private:
|
||||
}
|
||||
|
||||
if (transportCount)
|
||||
LOG(logLevelDebug, "PVA client context destroyed with %d transport(s) active.", transportCount);
|
||||
LOG(logLevelDebug, "PVA client context destroyed with %u transport(s) active.", (unsigned)transportCount);
|
||||
}
|
||||
|
||||
void destroyAllChannels() {
|
||||
|
@ -369,7 +369,7 @@ void ServerContextImpl::destroyAllTransports()
|
||||
if (size == 0)
|
||||
return;
|
||||
|
||||
LOG(logLevelDebug, "Server context still has %d transport(s) active and closing...", size);
|
||||
LOG(logLevelDebug, "Server context still has %zu transport(s) active and closing...", size);
|
||||
|
||||
for (size_t i = 0; i < size; i++)
|
||||
{
|
||||
|
@ -9,6 +9,7 @@
|
||||
|
||||
#include <string>
|
||||
|
||||
#include <compilerDependencies.h>
|
||||
#include <shareLib.h>
|
||||
|
||||
namespace epics {
|
||||
@ -37,7 +38,7 @@ OFF
|
||||
*/
|
||||
|
||||
|
||||
epicsShareFunc void pvAccessLog(pvAccessLogLevel level, const char* format, ...);
|
||||
epicsShareFunc void pvAccessLog(pvAccessLogLevel level, const char* format, ...) EPICS_PRINTF_STYLE(2, 3);
|
||||
epicsShareFunc void pvAccessSetLogLevel(pvAccessLogLevel level);
|
||||
epicsShareFunc bool pvAccessIsLoggable(pvAccessLogLevel level);
|
||||
|
||||
|
Reference in New Issue
Block a user