During this season of giving, you can show your support for the NTP Project by making a donation to Network Time Foundation.

Data Structures for Config Saving

A Log can be sent to a File, Syslog, or stderr.

So, the possible logging channels are

  • FILE

The logging channels take up parameters

FILE - path to the logging file


STDERR - stderr (is this a parameter?)

The corresponding to each combination of channel_type and channel_parameters, there shall be a list of tags that are to be logged

The data structure that I have in mind is like the following

A structure for a logging channel with members Logging Channel, Channel Parmeters, A linked list of tags, that shall be a linked list on its own, that are to be logged, corresponding to that channel.

typedef enum {
    STDOUT,     /* standard output */
    STDERROUT,  /* standard error output */
    FILEOUT,    /* file output */
    RBUFOUT,    /* ringbuffer output */
    SYSLOG      /* syslog output */
} logc_loggerType_t;

typedef struct {
    char            *category;
    LoggingTagsList *next;
} LoggingTagsList;

typedef struct {
    int             channel_number;
    char           *channel_parameter;
    LoggingTagsList categories;
    LoggingChannel *next;
} LoggingChannel;

And then when we encounter a tag, we can look it up in the channels' structures and log it accordingly if found.

-- ShubhamSinghal - 2013-07-20
Topic revision: r4 - 13 Oct 2013, HarlanStenn
Copyright © by the contributing authors.Use of this website indicates your agreement with, and acceptance of, the PrivacyPolicy, the WikiDisclaimer, and the PrivateWebPolicy.