grpc/src/python
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
..
grpcio [logging] Centralize configuration for trace flags (#36576) 2024-06-07 10:47:38 -07:00
grpcio_admin [Release] Bump version to 1.65.0-dev (on master branch) (#36544) 2024-05-06 14:41:36 -07:00
grpcio_channelz [Release] Bump version to 1.65.0-dev (on master branch) (#36544) 2024-05-06 14:41:36 -07:00
grpcio_csds [Release] Bump version to 1.65.0-dev (on master branch) (#36544) 2024-05-06 14:41:36 -07:00
grpcio_csm_observability [Python CSM] Changes to enable Python CSM interop tests (#36790) 2024-06-03 16:45:28 -07:00
grpcio_health_checking [Release] Bump version to 1.65.0-dev (on master branch) (#36544) 2024-05-06 14:41:36 -07:00
grpcio_observability [logging] Centralize configuration for trace flags (#36576) 2024-06-07 10:47:38 -07:00
grpcio_reflection [Release] Bump version to 1.65.0-dev (on master branch) (#36544) 2024-05-06 14:41:36 -07:00
grpcio_status [Release] Bump version to 1.65.0-dev (on master branch) (#36544) 2024-05-06 14:41:36 -07:00
grpcio_testing [Release] Bump version to 1.65.0-dev (on master branch) (#36544) 2024-05-06 14:41:36 -07:00
grpcio_tests [Python CSM] Fix interop client and server flag (#36827) 2024-06-06 08:36:53 -07:00
.gitignore [Python O11Y] Reapply registered method change (#35850) 2024-02-15 15:36:27 -08:00