[Reviewer: Ellie] Craft logging Enhanced Node Troubleshooting 

Added PDLog infrastructure (definition in new header, craft_dcea.h) and PDLogs for http and sip.
Probably won't exceed 2048 byte limit. It is possible for logs to be interspersed.  The MSG or log id is prominently displayed so it is possible to correlate the log entries.  Rsyslog does not permit formatting of the MSG field.  I am waiting for a response from Stephen Archer as to whether he would like the cause, effect, and action to appear.  It does add complexity.
David Collins

Sent from my iPad

On Sep 26, 2014, at 10:06 AM, "mirw" <notifications@github.com<mailto:notifications@github.com>> wrote:


In include/craft_dcea.h:

> +  /// The cause of the condition
> +  std::string _cause;
> +  /// The effect the conditon has on the system
> +  std::string _effect;
> +  // A list of actions to be taken for the condition
> +  std::string _action[MAX_ARG_SIZE];
> +};
> +
> +///
> +/// PDLog - For logs with no log arguments
> +class PDLog : public PDLogBase {
> + public:
> +  // Not that num is the size of the action list
> + PDLog(int log_id, int severity, const std::string& msg, const std::string& cause, const std::string& effect, int num, const char* action, ...) : PDLogBase(log_id, severity, msg, cause, effect)
> +   {
> +    va_list ap;


Do we not risk the logs being processed out-of-order, or with other logs interspersed? Is the 2048-byte-limit actually an issue - will we get logs that big? Should we just accept that logs won't have formatting/new-lines?

—
Reply to this email directly or view it on GitHub<https://github.com/Metaswitch/cpp-common/pull/184/files#r18094006>.