CUBRID Engine  latest
cas_error_log.c File Reference
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
#include <time.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <sys/time.h>
#include <assert.h>
#include "cas_common.h"
#include "cas_error_log.h"
#include "cas_util.h"
#include "broker_config.h"
#include "cas.h"
#include "cas_execute.h"
#include "broker_env_def.h"
#include "broker_filename.h"
#include "broker_util.h"
Include dependency graph for cas_error_log.c:

Go to the source code of this file.

Functions

static char * make_error_log_filename (char *filename_buf, size_t buf_size, const char *br_name)
 
static void cas_error_log_backup (void)
 
static void cas_log_write_internal (const char *fmt,...)
 
void cas_error_log_open (char *br_name)
 
void cas_error_log_close (bool flag)
 
void cas_error_log_write (int dbms_errno, const char *dbms_errmsg)
 
char * cas_error_log_get_eid (char *buf, size_t bufsz)
 

Variables

static FILE * error_log_fp = NULL
 
static char error_log_filepath [BROKER_PATH_MAX]
 
static long saved_error_log_fpos = 0
 
static int eid = 0
 

Function Documentation

static void cas_error_log_backup ( void  )
static

Definition at line 129 of file cas_error_log.c.

References assert, BROKER_PATH_MAX, and error_log_filepath.

Referenced by cas_error_log_write().

Here is the caller graph for this function:

void cas_error_log_close ( bool  flag)

Definition at line 113 of file cas_error_log.c.

References error_log_fp, NULL, and saved_error_log_fpos.

Referenced by cas_error_log_open(), cas_error_log_write(), cas_free(), cas_main(), and shard_cas_main().

Here is the caller graph for this function:

char* cas_error_log_get_eid ( char *  buf,
size_t  bufsz 
)

Definition at line 193 of file cas_error_log.c.

References eid, and NULL.

Referenced by get_error_log_eids().

Here is the caller graph for this function:

void cas_error_log_open ( char *  br_name)

Definition at line 86 of file cas_error_log.c.

References BROKER_PATH_MAX, cas_error_log_close(), error_log_filepath, error_log_fp, make_error_log_filename(), NULL, and saved_error_log_fpos.

Referenced by cas_error_log_write(), cas_main(), and shard_cas_main().

Here is the caller graph for this function:

void cas_error_log_write ( int  dbms_errno,
const char *  dbms_errmsg 
)
static void cas_log_write_internal ( const char *  fmt,
  ... 
)
static

Definition at line 142 of file cas_error_log.c.

References error_log_fp, NULL, p, and ut_time_string().

Referenced by cas_error_log_write().

Here is the caller graph for this function:

static char * make_error_log_filename ( char *  filename_buf,
size_t  buf_size,
const char *  br_name 
)
static

Definition at line 64 of file cas_error_log.c.

References assert, BROKER_PATH_MAX, cas_shard_flag, dirname(), FID_CUBRID_ERR_DIR, get_cubrid_file(), NULL, ON, shm_as_index, shm_proxy_id, shm_shard_cas_id, and shm_shard_id.

Referenced by cas_error_log_open().

Here is the caller graph for this function:

Variable Documentation

char error_log_filepath[BROKER_PATH_MAX]
static

Definition at line 58 of file cas_error_log.c.

Referenced by cas_error_log_backup(), and cas_error_log_open().

FILE* error_log_fp = NULL
static
long saved_error_log_fpos = 0
static

Definition at line 59 of file cas_error_log.c.

Referenced by cas_error_log_close(), cas_error_log_open(), and cas_error_log_write().