diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2023-10-13 12:17:45 +0000 |
---|---|---|
committer | Laurent Bercot <ska@appnovation.com> | 2023-10-13 12:17:45 +0000 |
commit | ff9c276c144bc24c70f1d5b531a8fd412c34c3d9 (patch) | |
tree | 428e16ebf99802946e230853c76b2ae3b407c87b /src/include | |
parent | 8179edd85cd504058ec7c569ef87eebf5979646e (diff) | |
download | tipidee-ff9c276c144bc24c70f1d5b531a8fd412c34c3d9.tar.gz tipidee-ff9c276c144bc24c70f1d5b531a8fd412c34c3d9.tar.xz tipidee-ff9c276c144bc24c70f1d5b531a8fd412c34c3d9.zip |
Improved logging system
Signed-off-by: Laurent Bercot <ska@appnovation.com>
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/tipidee/log.h | 17 | ||||
-rw-r--r-- | src/include/tipidee/response.h | 3 | ||||
-rw-r--r-- | src/include/tipidee/tipidee.h | 1 |
3 files changed, 11 insertions, 10 deletions
diff --git a/src/include/tipidee/log.h b/src/include/tipidee/log.h index 98e6d0e..7453bb7 100644 --- a/src/include/tipidee/log.h +++ b/src/include/tipidee/log.h @@ -3,13 +3,14 @@ #ifndef TIPIDEE_LOG_H #define TIPIDEE_LOG_H -#include <sys/types.h> #include <stdint.h> +#include <skalibs/uint64.h> #include <skalibs/strerr.h> #include <skalibs/stralloc.h> #include <tipidee/rql.h> +#include <tipidee/headers.h> #define TIPIDEE_LOG_REQUEST 0x0001 #define TIPIDEE_LOG_REFERRER 0x0002 @@ -17,11 +18,11 @@ #define TIPIDEE_LOG_RESOURCE 0x0008 #define TIPIDEE_LOG_ANSWER 0x0010 #define TIPIDEE_LOG_SIZE 0x0020 -#define TIPIDEE_LOG_START 0x100 -#define TIPIDEE_LOG_CLIENTIP 0x0200 -#define TIPIDEE_LOG_CLIENTHOST 0x0400 -#define TIPIDEE_LOG_HOSTASPREFIX 0x1000 -#define TIPIDEE_LOG_DEBUG 0x10000 +#define TIPIDEE_LOG_START 0x0040 +#define TIPIDEE_LOG_CLIENTIP 0x0080 +#define TIPIDEE_LOG_CLIENTHOST 0x0100 +#define TIPIDEE_LOG_HOSTASPREFIX 0x0200 +#define TIPIDEE_LOG_DEBUG 0x0400 #define TIPIDEE_LOG_DEFAULT (TIPIDEE_LOG_REQUEST | TIPIDEE_LOG_ANSWER | TIPIDEE_LOG_SIZE) @@ -37,9 +38,9 @@ struct tipidee_resattr_s extern void tipidee_log_start (uint32_t, char const *, char const *) ; extern void tipidee_log_exit (uint32_t, unsigned int) ; -extern void tipidee_log_request (uint32_t, tipidee_rql const *, char const *, char const *, stralloc *) ; +extern void tipidee_log_request (uint32_t, tipidee_rql const *, tipidee_headers const *, stralloc *) ; extern void tipidee_log_resource (uint32_t, tipidee_rql const *, char const *, char const *, tipidee_resattr const *) ; -extern void tipidee_log_answer (uint32_t, tipidee_rql const *, unsigned int, off_t) ; +extern void tipidee_log_answer (uint32_t, tipidee_rql const *, unsigned int, uint64_t) ; #define tipidee_log_debug(v, ...) do { if ((v) & TIPIDEE_LOG_DEBUG) strerr_warn(PROG, ": debug: ", __VA_ARGS__) ; } while (0) diff --git a/src/include/tipidee/response.h b/src/include/tipidee/response.h index d549532..d969d9c 100644 --- a/src/include/tipidee/response.h +++ b/src/include/tipidee/response.h @@ -22,7 +22,6 @@ struct tipidee_response_header_builtin_s } ; extern size_t tipidee_response_status (buffer *, tipidee_rql const *, unsigned int, char const *) ; -#define tipidee_response_status_line(b, rql, line) tipidee_response_status(b, rql, 0, (line)) extern size_t tipidee_response_header_date_fmt (char *, size_t, tain const *) ; extern size_t tipidee_response_header_date (char *, size_t, tain const *) ; @@ -32,7 +31,7 @@ extern size_t tipidee_response_header_lastmodified (char *, size_t, struct stat extern size_t tipidee_response_header_common_put (buffer *, uint32_t, tain const *) ; #define tipidee_response_header_common_put_g(b, options) tipidee_response_header_common_put(b, (options), &STAMP) -extern size_t tipidee_response_error (buffer *, tipidee_rql const *, char const *, char const *, uint32_t) ; +extern size_t tipidee_response_error (buffer *, tipidee_rql const *, unsigned int, char const *, char const *, uint32_t) ; extern tipidee_response_header_builtin const *tipidee_response_header_builtin_table ; extern char const *tipidee_response_header_builtin_search (char const *) ; diff --git a/src/include/tipidee/tipidee.h b/src/include/tipidee/tipidee.h index 7634366..7153b7d 100644 --- a/src/include/tipidee/tipidee.h +++ b/src/include/tipidee/tipidee.h @@ -6,6 +6,7 @@ #include <tipidee/config.h> #include <tipidee/conf.h> #include <tipidee/headers.h> +#include <tipidee/log.h> #include <tipidee/method.h> #include <tipidee/response.h> #include <tipidee/rql.h> |