]> git.kaiwu.me - haproxy.git/commit
REORG: include: move log.h to haproxy/log{,-t}.h
authorWilly Tarreau <w@1wt.eu>
Thu, 4 Jun 2020 20:01:04 +0000 (22:01 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 11 Jun 2020 08:18:58 +0000 (10:18 +0200)
commitaeed4a85d6c95382f26ff34d9e944c71e21be711
tree92a033cd54f515e4c7f338b120aeff4fbbfcb273
parentc6599682d5b8aff3ebdef14264991a4e801d4124
REORG: include: move log.h to haproxy/log{,-t}.h

The current state of the logging is a real mess. The main problem is
that almost all files include log.h just in order to have access to
the alert/warning functions like ha_alert() etc, and don't care about
logs. But log.h also deals with real logging as well as log-format and
depends on stream.h and various other things. As such it forces a few
heavy files like stream.h to be loaded early and to hide missing
dependencies depending where it's loaded. Among the missing ones is
syslog.h which was often automatically included resulting in no less
than 3 users missing it.

Among 76 users, only 5 could be removed, and probably 70 don't need the
full set of dependencies.

A good approach would consist in splitting that file in 3 parts:
  - one for error output ("errors" ?).
  - one for log_format processing
  - and one for actual logging.
65 files changed:
contrib/modsecurity/modsec_wrapper.c
include/common/cfgparse.h
include/haproxy/connection.h
include/haproxy/defaults.h
include/haproxy/log-t.h [moved from include/types/log.h with 69% similarity]
include/haproxy/log.h [moved from include/proto/log.h with 81% similarity]
include/haproxy/trace.h
include/proto/server.h
include/types/proxy.h
include/types/spoe.h
src/51d.c
src/acl.c
src/action.c
src/auth.c
src/backend.c
src/cache.c
src/cfgparse.c
src/check.c
src/cli.c
src/da.c
src/debug.c
src/dns.c
src/ev_evports.c
src/fcgi-app.c
src/fd.c
src/flt_spoe.c
src/flt_trace.c
src/frontend.c
src/haproxy.c
src/hlua_fcn.c
src/http_act.c
src/http_ana.c
src/http_fetch.c
src/listener.c
src/log.c
src/map.c
src/mux_fcgi.c
src/mux_h1.c
src/mworker-prog.c
src/mworker.c
src/namespace.c
src/pattern.c
src/peers.c
src/pool.c
src/proto_sockpair.c
src/proto_tcp.c
src/proto_uxst.c
src/proxy.c
src/raw_sock.c
src/regex.c
src/sample.c
src/session.c
src/signal.c
src/sink.c
src/ssl_ckch.c
src/ssl_crtlist.c
src/ssl_sock.c
src/stats.c
src/stick_table.c
src/stream.c
src/tcp_rules.c
src/trace.c
src/uri_auth.c
src/wdt.c
src/wurfl.c