grpc/tools/codegen/core
AJ Heller c9fdef1317 [logging] Centralize configuration for trace flags (#36576)
All TraceFlags are now configured in `src/core/lib/debug/trace_flags.yaml`. The format is:

```
my_flag:
  default: false                   # the default value; default=false
  description: Some Description
  debug_only: false                # debug_only flags only work in debug builds; default=false
  internal: false                  # internal flags will not show up in documentation; default=false
```

To regenerate the trace flag source code, run `tools/codegen/core/gen_trace_flags.py` (requires mako). This script is also run when sanity checking.

This PR also adds two new features:

### Glob-based flag configuration

Trace flag configuration now supports `?` (single wildcard character) and `*` (one or more wildcard characters).  For example, using `GRPC_TRACE='event_engine*'` will enable all flags that match that glob. It expands to:

* event_engine
* event_engine_client_channel_resolver
* event_engine_dns
* event_engine_endpoint
* event_engine_endpoint_data
* event_engine_poller

### A cleaner trace-logging macro in abseil logging format

If your goal is only to add log statements when the `fault_injection_filter` trace flag is enabled, you can use the macro:

```
GRPC_TRACE_LOG(fault_injection, INFO) << "Filtered:" << 42;
```

When the trace flag is enabled, the the log will show something like this:
```
I0000 00:00:1715733657.430042      16 file.cc:174] Filtered:42
```

----

Note: just like with the gpr_log to abseil logging conversion, the pre-existing trace logging usages can be replaced with the new tracing macro across multiple PRs.

Closes #36576

PiperOrigin-RevId: 641295215
2024-06-07 10:47:38 -07:00
..
templates [logging] Centralize configuration for trace flags (#36576) 2024-06-07 10:47:38 -07:00
BUILD Internal change 2023-12-13 20:06:30 -08:00
experiments_compiler.py [chaotic-good] Bring up core e2e tests (#35663) 2024-02-09 13:34:46 -08:00
gen_config_vars.py [reorg] move test/core/util -> test/core/test_util (#36446) 2024-04-29 17:06:40 -07:00
gen_experiments.py Make gen_experiments.py runnable internally also 2023-12-18 08:19:11 -08:00
gen_grpc_tls_credentials_options.py [reorg] move test/core/util -> test/core/test_util (#36446) 2024-04-29 17:06:40 -07:00
gen_header_frame.py [Python] Migrate from yapf to black (#33138) 2023-06-09 15:08:55 -07:00
gen_huffman_decompressor.cc [hpack] Rollforward huffman read optimization (#33657) 2023-07-11 15:26:54 -07:00
gen_if_list.py [Python] Migrate from yapf to black (#33138) 2023-06-09 15:08:55 -07:00
gen_join.py [logging] Centralize configuration for trace flags (#36576) 2024-06-07 10:47:38 -07:00
gen_seq.py [logging] Centralize configuration for trace flags (#36576) 2024-06-07 10:47:38 -07:00
gen_server_registered_method_bad_client_test_body.py [Python] Migrate from yapf to black (#33138) 2023-06-09 15:08:55 -07:00
gen_stats_data.py [reorg] move telemetry code to src/core/telemetry (#36644) 2024-05-23 15:54:07 -07:00
gen_trace_flags.py [logging] Centralize configuration for trace flags (#36576) 2024-06-07 10:47:38 -07:00
gen_trace_flags_ci.sh [logging] Centralize configuration for trace flags (#36576) 2024-06-07 10:47:38 -07:00
gen_upb_api.sh [deps] Upgrade protobuf version to v25.0 (#34513) 2023-11-10 00:11:09 -08:00
gen_upb_api_from_bazel_xml.py [build] Update `envoy-api` and `xds` dependencies (#35603) 2024-01-23 15:15:47 -08:00
optimize_arena_pool_sizes.py [Python] Migrate from yapf to black (#33138) 2023-06-09 15:08:55 -07:00