[Reviewer: Graeme] Craft logging Enhanced Node Troubleshooting 

Added PDLog infrastructure (definition in new header, craft_dcea.h) and PDLogs for http and sip.
Can you clarify?  Do you mean the #pragma’s?

From: graemerobertson [mailto:notifications@github.com]
Sent: Wednesday, October 29, 2014 2:33 PM
To: Metaswitch/cpp-common
Cc: David Collins
Subject: Re: [cpp-common] [Reviewer: Graeme] Craft logging Enhanced Node Troubleshooting (#184)


In include/craft_ent_definitions.h:

> +  };

> +  void log() const

> +  {

> +    // The format for the snprintf is defined by buf

> +    char buf[MAX_FORMAT_LINE];

> +    // The pragmas are used to avoid compiler warnings

> +    // Normally this would be a security issue but the

> +    // template type insures the log call agrrems with the format

> +#pragma GCC diagnostic push

> +#pragma GCC diagnostic ignored "-Wformat-security"

> +    snprintf(buf, MAX_FORMAT_LINE - 2, (const char*)_msg.c_str());

> +#pragma GCC diagnostic pop

> +    dcealog(buf);

> +  };

> +

> +protected:

We don't need this

—
Reply to this email directly or view it on GitHub<https://github.com/Metaswitch/cpp-common/pull/184/files#r19565572>.