CUBRID Engine  latest
cas_log.h
Go to the documentation of this file.
1 /*
2  * Copyright 2008 Search Solution Corporation
3  * Copyright 2016 CUBRID Corporation
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  */
18 
19 
20 /*
21  * cas_log.h -
22  */
23 
24 #ifndef _CAS_LOG_H_
25 #define _CAS_LOG_H_
26 
27 #ident "$Id$"
28 
29 typedef enum
30 {
35 
36 extern void cas_log_open (char *br_name);
37 extern void cas_log_reset (char *br_name);
38 extern void cas_log_close (bool flag);
39 #ifdef CAS_ERROR_LOG
40 extern void cas_error_log (int err_code, char *err_msg, int client_ip_addr);
41 #endif
42 
43 extern int cas_access_log (struct timeval *start_time, int as_index, int client_ip_addr, char *dbname, char *dbuser,
44  ACCESS_LOG_TYPE log_type);
45 extern void cas_log_end (int mode, int run_time_sec, int run_time_msec);
46 extern void cas_log_write_nonl (unsigned int seq_num, bool unit_start, const char *fmt, ...);
47 extern void cas_log_write (unsigned int seq_num, bool unit_start, const char *fmt, ...);
48 extern void cas_log_write_and_end (unsigned int seq_num, bool unit_start, const char *fmt, ...);
49 extern void cas_log_write2_nonl (const char *fmt, ...);
50 extern void cas_log_write2 (const char *fmt, ...);
51 extern void cas_log_write_value_string (char *value, int size);
52 extern void cas_log_write_query_string (char *query, int size);
53 extern void cas_log_write_client_ip (const unsigned char *ip_addr);
54 extern void cas_log_write_query_string_nonl (char *query, int size);
55 
56 #define ARG_FILE_LINE __FILE__, __LINE__
57 #if defined (NDEBUG)
58 #define cas_log_debug(...)
59 #else
60 extern void cas_log_debug (const char *file_name, const int line_no, const char *fmt, ...);
61 #endif /* !NDEBUG */
62 
63 extern char *cas_log_query_plan_file (int id);
64 extern void cas_log_query_info_init (int id, char is_only_query_plan);
65 
66 extern void cas_slow_log_open (char *br_name);
67 extern void cas_slow_log_reset (char *br_name);
68 extern void cas_slow_log_close (void);
69 extern void cas_slow_log_end (void);
70 extern void cas_slow_log_write (struct timeval *log_time, unsigned int seq_num, bool unit_start, const char *fmt, ...);
71 extern void cas_slow_log_write_and_end (struct timeval *log_time, unsigned int seq_num, const char *fmt, ...);
72 
73 extern void cas_slow_log_write2 (const char *fmt, ...);
74 extern void cas_slow_log_write_value_string (char *value, int size);
75 extern void cas_slow_log_write_query_string (char *query, int size);
76 #endif /* _CAS_LOG_H_ */
void cas_slow_log_write(struct timeval *log_time, unsigned int seq_num, bool unit_start, const char *fmt,...)
Definition: cas_log.c:1085
static char * dbuser
void cas_log_reset(char *br_name)
Definition: cas_log.c:211
void cas_log_close(bool flag)
Definition: cas_log.c:234
void cas_slow_log_close(void)
Definition: cas_log.c:1021
void cas_slow_log_write2(const char *fmt,...)
Definition: cas_log.c:1105
void cas_log_write2_nonl(const char *fmt,...)
Definition: cas_log.c:584
void cas_log_write_and_end(unsigned int seq_num, bool unit_start, const char *fmt,...)
Definition: cas_log.c:533
void cas_log_write_client_ip(const unsigned char *ip_addr)
Definition: cas_log.c:686
void cas_log_end(int mode, int run_time_sec, int run_time_msec)
Definition: cas_log.c:319
void cas_slow_log_reset(char *br_name)
Definition: cas_log.c:998
void cas_log_write2(const char *fmt,...)
Definition: cas_log.c:604
void cas_slow_log_end(void)
Definition: cas_log.c:1033
void cas_log_open(char *br_name)
Definition: cas_log.c:163
void cas_slow_log_open(char *br_name)
Definition: cas_log.c:966
static enum scanner_mode mode
static char * dbname
ACCESS_LOG_TYPE
Definition: cas_log.h:29
static struct timeval start_time
void cas_slow_log_write_value_string(char *value, int size)
Definition: cas_log.c:1125
void cas_log_write_query_string_nonl(char *query, int size)
Definition: cas_log.c:641
void cas_log_write_nonl(unsigned int seq_num, bool unit_start, const char *fmt,...)
Definition: cas_log.c:442
void cas_slow_log_write_and_end(struct timeval *log_time, unsigned int seq_num, const char *fmt,...)
Definition: cas_log.c:1062
void cas_slow_log_write_query_string(char *query, int size)
Definition: cas_log.c:1141
void cas_log_write_value_string(char *value, int size)
Definition: cas_log.c:625
void cas_log_debug(const char *file_name, const int line_no, const char *fmt,...)
Definition: cas_log.c:701
void cas_log_write_query_string(char *query, int size)
Definition: cas_log.c:647
char * cas_log_query_plan_file(int id)
Definition: cas_log.c:892
void cas_log_query_info_init(int id, char is_only_query_plan)
Definition: cas_log.c:871
int cas_access_log(struct timeval *start_time, int as_index, int client_ip_addr, char *dbname, char *dbuser, ACCESS_LOG_TYPE log_type)
Definition: cas_log.c:784
void cas_log_write(unsigned int seq_num, bool unit_start, const char *fmt,...)
Definition: cas_log.c:506