nmc-utils  0.1.1
nmlogd.c File Reference
#include <stdio.h>
#include <getopt.h>
#include <sys/ioctl.h>
#include <unistd.h>
#include <sys/select.h>
#include <string.h>
#include <sys/time.h>
#include <sys/types.h>
#include <termios.h>
#include <fcntl.h>
#include <signal.h>
#include <stdlib.h>
#include <stdint.h>
#include <errno.h>
#include <sys/epoll.h>
#include <syslog.h>
#include <easynmc.h>
Include dependency graph for nmlogd.c:

Go to the source code of this file.

Data Structures

struct  nmc_logger_core

Macros

#define _GNU_SOURCE
#define MODE_SYSLOG   2
#define MODE_STDOUT   1
#define MODE_FILE   0
#define dbg(fmt,...)
#define err(fmt,...)
#define BUFSIZE   2048

Functions

void usage (char *nm)
int add_core_to_logger (char *prefix, int numcore, int efd)
void log_string_stdout (struct nmc_logger_core *core, char *str)
void log_string_syslog (struct nmc_logger_core *core, char *str)
void log_string_file (struct nmc_logger_core *core, char *str)
int main (int argc, char *argv[])

Macro Definition Documentation

#define _GNU_SOURCE

Definition at line 22 of file nmlogd.c.

#define BUFSIZE   2048

Referenced by main().

#define dbg (   fmt,
  ... 
)
Value:
if (g_debug > 1) { \
fprintf(stderr, "nmlogd: " fmt, ##__VA_ARGS__); \
}

Definition at line 55 of file nmlogd.c.

Referenced by main().

#define err (   fmt,
  ... 
)
Value:
if (g_debug) { \
fprintf(stderr, "nmlogd: " fmt, ##__VA_ARGS__); \
}

Definition at line 59 of file nmlogd.c.

Referenced by main().

#define MODE_FILE   0

Definition at line 48 of file nmlogd.c.

#define MODE_STDOUT   1

Definition at line 47 of file nmlogd.c.

#define MODE_SYSLOG   2

Definition at line 46 of file nmlogd.c.

Function Documentation

int add_core_to_logger ( char *  prefix,
int  numcore,
int  efd 
)
void log_string_file ( struct nmc_logger_core core,
char *  str 
)

Definition at line 161 of file nmlogd.c.

void log_string_stdout ( struct nmc_logger_core core,
char *  str 
)

Definition at line 151 of file nmlogd.c.

References nmc_logger_core::logprefix.

Referenced by main().

void log_string_syslog ( struct nmc_logger_core core,
char *  str 
)

Definition at line 156 of file nmlogd.c.

int main ( int  argc,
char *  argv[] 
)

Definition at line 166 of file nmlogd.c.

References add_core_to_logger(), BUFSIZE, dbg, err, log_string_stdout(), nmc_logger_core::rfd, and usage().

void usage ( char *  nm)

Definition at line 64 of file nmlogd.c.