From b9a04b9e404a7b50764a3ad982ef565a8dba1680 Mon Sep 17 00:00:00 2001 From: e_forbes Date: Tue, 9 Dec 2025 17:18:24 +0000 Subject: [PATCH] Modifies the readme for contextual logging to use fields pkg --- v2/log/README.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/v2/log/README.md b/v2/log/README.md index 70b1ac2..622946e 100644 --- a/v2/log/README.md +++ b/v2/log/README.md @@ -99,13 +99,12 @@ together by various fields for investigatory purposes. ```go ctx := log.WithFields( - slog.String("project_id", "1234abc") - slog.String("some_field", "abc123") + slog.String(fields.GitLabUserName, "1234abc") ) logger.InfoContext(ctx, "hello world") -// emitted log line will contain the `project_id` and `some_field` fields alongside -// "hello world" +// emitted log line will contain the `gl_user_name` field alongside +// "hello world" - this is imported from the `fields` package. ``` ### Canonical Logger -- GitLab