ARPDAS_QNX6 1.0
|
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include <stdarg.h>
#include <stdlib.h>
#include <time.h>
#include "oui.h"
#include "nortlib.h"
#include "msg.h"
#include "tm.h"
Go to the source code of this file.
Defines | |
#define | MSG_MAX_HDR_LEN 10 |
#define | MSG_MAX_INTERNAL 250 |
Functions | |
const char * | msghdr_init (const char *hdr_default, int argc, char **argv) |
void | msg_set_hdr (const char *hdr) |
void | msg_init_options (const char *hdr, int argc, char **argv) |
static void | write_msg (char *buf, int nb, FILE *fp, char *dest) |
int | msg (int level, const char *fmt,...) |
int | msgv (int level, const char *fmt, va_list args) |
Variables | |
static char | msg_app_hdr [MSG_MAX_HDR_LEN+1] |
static int | write_to_memo = 1 |
static int | write_to_stderr = 0 |
static int | write_to_file = 0 |
FILE * | memo_fp |
FILE * | file_fp |
#define MSG_MAX_HDR_LEN 10 |
Definition at line 30 of file msg.c.
Referenced by msg_set_hdr().
#define MSG_MAX_INTERNAL 250 |
int msg | ( | int | level, |
const char * | fmt, | ||
... | |||
) |
msg() supports the nl_error() interface, but provides a considerable amount of additional functionality to support logging of messages within an application with multiple executables. Through command-line options, msg() can be configured to log to stderr and/or to a log file and/or to the memo application, and adds a timestamp to each message. See nl_error() for definition of the level options.
Definition at line 107 of file msg.c.
References msgv().
Referenced by Ser_Sel::not_float(), Ser_Sel::report_err(), and Ser_Sel::report_ok().
void msg_init_options | ( | const char * | hdr, |
int | argc, | ||
char ** | argv | ||
) |
Definition at line 50 of file msg.c.
References file_fp, memo_fp, msg_set_hdr(), nl_debug_level, opt_string, OPTIND_RESET, tm_dev_name(), write_to_file, write_to_memo, and write_to_stderr.
void msg_set_hdr | ( | const char * | hdr | ) |
Definition at line 35 of file msg.c.
References msg_app_hdr, and MSG_MAX_HDR_LEN.
Referenced by msg_init_options().
const char* msghdr_init | ( | const char * | hdr_default, |
int | argc, | ||
char ** | argv | ||
) |
int msgv | ( | int | level, |
const char * | fmt, | ||
va_list | args | ||
) |
Definition at line 126 of file msg.c.
References file_fp, memo_fp, msg_app_hdr, MSG_MAX_INTERNAL, nl_debug_level, write_msg(), write_to_file, write_to_memo, and write_to_stderr.
Referenced by msg(), and Ser_Sel::report_err().
static void write_msg | ( | char * | buf, |
int | nb, | ||
FILE * | fp, | ||
char * | dest | ||
) | [static] |
FILE * file_fp |
Definition at line 33 of file msg.c.
Referenced by msg_init_options(), and msgv().
FILE* memo_fp |
Definition at line 33 of file msg.c.
Referenced by msg_init_options(), and msgv().
char msg_app_hdr[MSG_MAX_HDR_LEN+1] [static] |
Definition at line 31 of file msg.c.
Referenced by msg_set_hdr(), and msgv().
int write_to_file = 0 |
Definition at line 32 of file msg.c.
Referenced by msg_init_options(), and msgv().
int write_to_memo = 1 [static] |
Definition at line 32 of file msg.c.
Referenced by msg_init_options(), and msgv().
int write_to_stderr = 0 |
Definition at line 32 of file msg.c.
Referenced by msg_init_options(), and msgv().