mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-04-28 13:58:08 +00:00
MINOR: log: add log_orig_to_str() function
Get human readable string from log_orig enum members.
This commit is contained in:
parent
2a91bd52ad
commit
b52862d401
@ -64,6 +64,8 @@ void syslog_fd_handler(int fd);
|
|||||||
int init_log_buffers(void);
|
int init_log_buffers(void);
|
||||||
void deinit_log_buffers(void);
|
void deinit_log_buffers(void);
|
||||||
|
|
||||||
|
const char *log_orig_to_str(enum log_orig orig);
|
||||||
|
|
||||||
void lf_expr_init(struct lf_expr *expr);
|
void lf_expr_init(struct lf_expr *expr);
|
||||||
int lf_expr_dup(const struct lf_expr *orig, struct lf_expr *dest);
|
int lf_expr_dup(const struct lf_expr *orig, struct lf_expr *dest);
|
||||||
void lf_expr_xfer(struct lf_expr *src, struct lf_expr *dst);
|
void lf_expr_xfer(struct lf_expr *src, struct lf_expr *dst);
|
||||||
|
24
src/log.c
24
src/log.c
@ -88,6 +88,30 @@ static const struct log_fmt_st log_formats[LOG_FORMATS] = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* get human readable representation for log_orig enum members */
|
||||||
|
const char *log_orig_to_str(enum log_orig orig)
|
||||||
|
{
|
||||||
|
switch (orig) {
|
||||||
|
case LOG_ORIG_SESS_ERROR:
|
||||||
|
return "sess_error";
|
||||||
|
case LOG_ORIG_SESS_KILL:
|
||||||
|
return "sess_killed";
|
||||||
|
case LOG_ORIG_TXN_ACCEPT:
|
||||||
|
return "txn_accept";
|
||||||
|
case LOG_ORIG_TXN_REQUEST:
|
||||||
|
return "txn_request";
|
||||||
|
case LOG_ORIG_TXN_CONNECT:
|
||||||
|
return "txn_connect";
|
||||||
|
case LOG_ORIG_TXN_RESPONSE:
|
||||||
|
return "txn_response";
|
||||||
|
case LOG_ORIG_TXN_CLOSE:
|
||||||
|
return "txn_close";
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return "unspec";
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This map is used with all the FD_* macros to check whether a particular bit
|
* This map is used with all the FD_* macros to check whether a particular bit
|
||||||
* is set or not. Each bit represents an ASCII code. ha_bit_set() sets those
|
* is set or not. Each bit represents an ASCII code. ha_bit_set() sets those
|
||||||
|
Loading…
Reference in New Issue
Block a user