databricks-cli/libs
Pieter Noordhuis 32a29c6af4
Add structured logging infrastructure (#246)
New global flags:
* `--log-file FILE`: can be literal `stdout`, `stderr`, or a file name (default `stderr`)
* `--log-level LEVEL`: can be `error`, `warn`, `info`, `debug`, `trace`, or `disabled` (default `disabled`)
* `--log-format TYPE`: can be `text` or `json` (default `text`)

New functions in the `log` package take a `context.Context` and retrieve
the logger from said context.

Because we carry the logger in a context, adding
[attributes](https://pkg.go.dev/golang.org/x/exp/slog#hdr-Attrs_and_Values)
to the logger can be done as follows:

```go
ctx = log.NewContext(ctx, log.GetLogger(ctx).With("foo", "bar"))
```
2023-03-16 14:46:53 +01:00
..
auth Initialize BRICKS_CLI_PATH and increase default OAuth timeout (#237) 2023-03-08 16:14:24 +01:00
filer Escape URL in filer (#236) 2023-03-08 14:27:05 +01:00
fileset Don't sync symlink folders (#205) 2023-02-15 17:02:54 +01:00
flags Add structured logging infrastructure (#246) 2023-03-16 14:46:53 +01:00
git Locate and use global excludes file (#191) 2023-02-02 12:25:53 +01:00
log Add structured logging infrastructure (#246) 2023-03-16 14:46:53 +01:00
notebook Detect Jupyter notebook files (#219) 2023-02-21 13:49:01 +01:00
sync Path escape filepaths in the URL (#250) 2023-03-15 17:25:57 +01:00
testfile Refactor and cover edge cases in sync integration tests (#160) 2023-01-10 13:16:30 +01:00