Data Structures

sst/elements/genericProc/programs/libcprops/log.c File Reference

libcprops logging facilities implementation More...

#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <signal.h>
#include <time.h>
#include <errno.h>
#include "log.h"
#include "util.h"
#include "common.h"
#include "hashtable.h"

Data Structures

struct  _error_code_legend



#define PRECISE_TIME_FACTOR   1000
#define LINELEN   81
#define CHARS_PER_LINE   16
typedef struct _error_code_legend error_code_legend
static FILE * logfile = NULL
static char * log_filename = NULL
static int loglevel = 1
static cp_hashtablethread_id
long thread_count
error_code_legend error_messages []
static cp_hashtableerror_message_lookup
static int log_closing = 0
static char * cc_time_format = DEFAULT_TIME_FORMAT
static char * print_char = "ðñòóôõö÷øùúûüýþÿ"
static long get_thread_serial (long tno)
int cp_log_init (char *filename, int verbosity)
int cp_log_reopen ()
int cp_log_close ()
void cp_log (const char *fmt,...)
 unconditionally log a message
void cp_nlog (size_t len, const char *fmt,...)
 unconditionally log a limited length message
void cp_log_set_time_format (char *time_format)
static void cc_printout (char *type, char *fmt, va_list argp)
static void cp_error_printout (char *type, char *fmt, va_list argp)
void cp_debug (char *fmt,...)
void cp_debuginfo (char *fmt,...)
void cp_info (char *fmt,...)
void cp_warn (char *fmt,...)
 print out a LOG_LEVEL_WARNING log message
void cp_error (int code, char *fmt,...)
 print out a LOG_LEVEL_ERROR log message
void cp_perror (int code, int errno_code, char *fmt,...)
 print out a LOG_LEVEL_ERROR log message with an errno code
void cp_fatal (int code, char *fmt,...)
 print out a LOG_LEVEL_FATAL log message and exit.
void die (int code, const char *fmt,...)
void cp_dump (int levelprm, cp_string *str)
 hex dump a cp_string
void cp_ndump (int levelprm, cp_string *str, size_t len)
 hex dump up to len bytes of a cp_string

Detailed Description

libcprops logging facilities implementation


Function Documentation

void cp_fatal ( int  code,
char *  msg,
  ... 
)

print out a LOG_LEVEL_FATAL log message and exit.

if log_level is LOG_LEVEL_SILENT, the error message is supressed but the process still exits.

References LOG_LEVEL_FATAL.

Referenced by cp_client_init().