git-commit-vandalism/trace2/tr2_cfg.h
Josh Steadmon 3d3adaad91 trace2: teach Git to log environment variables
Via trace2, Git can already log interesting config parameters (see the
trace2_cmd_list_config() function). However, this can grant an
incomplete picture because many config parameters also allow overrides
via environment variables.

To allow for more complete logs, we add a new trace2_cmd_list_env_vars()
function and supporting implementation, modeled after the pre-existing
config param logging implementation.

Signed-off-by: Josh Steadmon <steadmon@google.com>
Acked-by: Jeff Hostetler <jeffhost@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-03-23 13:14:53 -07:00

28 lines
673 B
C

#ifndef TR2_CFG_H
#define TR2_CFG_H
/*
* Iterate over all config settings and emit 'def_param' events for the
* "interesting" ones to TRACE2.
*/
void tr2_cfg_list_config_fl(const char *file, int line);
/*
* Iterate over all "interesting" environment variables and emit 'def_param'
* events for them to TRACE2.
*/
void tr2_list_env_vars_fl(const char *file, int line);
/*
* Emit a "def_param" event for the given key/value pair IF we consider
* the key to be "interesting".
*/
void tr2_cfg_set_fl(const char *file, int line, const char *key,
const char *value);
void tr2_cfg_free_patterns(void);
void tr2_cfg_free_env_vars(void);
#endif /* TR2_CFG_H */