Updates the doc string for logging.WithFieldsFromContext and logging.WithFieldsFromContextAndCallMeta. I mistakenly thought these accumulated, so when I tried using one helper for logging some SQL query metadata and the traceID, only the traceID was getting logged since it overwrote my previous field extractor func. Without reading the source, it's not entirely obvious this is the behavior. Additionally, WithFieldsFromContext and WithFieldsFromContextAndCallMeta are mutually exclusive, so it should be documented only one should be used, and what happens when you use both, or either one of them more than once.
Changes
Updates the doc string for
logging.WithFieldsFromContext
andlogging.WithFieldsFromContextAndCallMeta
. I mistakenly thought these accumulated, so when I tried using one helper for logging some SQL query metadata and the traceID, only the traceID was getting logged since it overwrote my previous field extractor func. Without reading the source, it's not entirely obvious this is the behavior. Additionally,WithFieldsFromContext
andWithFieldsFromContextAndCallMeta
are mutually exclusive, so it should be documented only one should be used, and what happens when you use both, or either one of them more than once.