databricks-cli/cmd
Pieter Noordhuis 60a8abdcd7
Rewrite the friendly log handler (#1038)
## Changes

It wasn't working because it deferred to the regular `slog.TextHandler`
for the `WithAttr` and `WithGroup` functions. Both of these functions
don't mutate the handler but return a new one. When the top-level logger
called one of these, log records in that context used the standard
handler instead of ours.

To implement tracking of attributes and groups, I followed the guide at
https://github.com/golang/example/blob/master/slog-handler-guide/README.md
for writing custom handlers.

## Tests

The new tests demonstrate formatting through `t.Log` and look good.
2023-12-01 12:17:04 +00:00
..
account Add documentation for positional args in commands generated from the Databricks OpenAPI specification (#1033) 2023-11-30 16:22:23 +00:00
api Update Go SDK to v0.19.0 (#729) 2023-09-05 09:43:57 +00:00
auth Tolerate missing .databrickscfg file during `databricks auth login` (#1003) 2023-11-23 09:04:54 +00:00
bundle Add mlops-stacks to the default `databricks bundle init` prompt (#988) 2023-11-28 09:04:06 +00:00
configure Filter out system clusters for `--configure-cluster` (#1031) 2023-11-30 09:59:11 +00:00
fs Remove dependency on global state for remaining commands (#613) 2023-07-27 10:03:08 +00:00
labs Fix `panic: $HOME is not set` (#1027) 2023-11-29 19:08:27 +00:00
root Rewrite the friendly log handler (#1038) 2023-12-01 12:17:04 +00:00
sync Make `file_path` and `artifact_path` fields consistent with json tag (#987) 2023-11-15 13:37:26 +00:00
version Added description for version command (#737) 2023-09-06 08:41:47 +00:00
workspace Add documentation for positional args in commands generated from the Databricks OpenAPI specification (#1033) 2023-11-30 16:22:23 +00:00
cmd.go Add `databricks labs` command group (#914) 2023-11-17 12:47:37 +00:00