)]}' { "commit": "a68e582fa157abff310e2a9a287b21a1fe1e1629", "tree": "9a87d1cebf0b4a4a4f8b3bdeda156412901b134e", "parents": [ "1de6713980dea447778ef6e71194d5eb54288072" ], "author": { "name": "Seth Vargo", "email": "seth@sethvargo.com", "time": "Tue Jan 17 13:38:31 2023 -0500" }, "committer": { "name": "Jonathan Amsterdam", "email": "jba@google.com", "time": "Wed Jan 18 13:47:22 2023 +0000" }, "message": "exp/slog: add example for custom levels and names\n\nThe recommended way to introduce new `Level` (or rename an existing\none) is via `HandlerOptions.ReplaceAttr`. However, this is not\nimmediately intuitive to package users.\n\nThis introduces an example that adds additional log levels and gives\nthem custom names in a `ReplaceAttr` function. Given the number of users\nwho will want to introduce custom log levels, this feels like a good\naddition to the library documentation.\n\nChange-Id: I175440368fa1d4ce548d9c769ca22fd613151941\nReviewed-on: https://go-review.googlesource.com/c/exp/+/462435\nReviewed-by: Jonathan Amsterdam \u003cjba@google.com\u003e\nRun-TryBot: Ian Lance Taylor \u003ciant@golang.org\u003e\nReviewed-by: Alan Donovan \u003cadonovan@google.com\u003e\nTryBot-Result: Gopher Robot \u003cgobot@golang.org\u003e\n", "tree_diff": [ { "type": "add", "old_id": "0000000000000000000000000000000000000000", "old_mode": 0, "old_path": "/dev/null", "new_id": "d0ec3a73839e8f91865d66901a8e2192e874edb1", "new_mode": 33188, "new_path": "slog/example_custom_levels_test.go" } ] }