Skip to content

Commit

Permalink
Syntax for configuring logs print color in profiles.yml (#4167)
Browse files Browse the repository at this point in the history
Previews:
- [Print output: Print
color](https://docs-getdbt-com-git-dbeatty-logs-print-color-dbt-labs.vercel.app/reference/global-configs/print-output#print-color)
- [Logs:
Color](https://docs-getdbt-com-git-dbeatty-logs-print-color-dbt-labs.vercel.app/reference/global-configs/logs#color)

## What are you changing in this pull request and why?

It's possible to configure this within `profiles.yml`, so let's document
how!

## Checklist
- [x] Review the [Content style
guide](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/content-style-guide.md)
and [About
versioning](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/single-sourcing-content.md#adding-a-new-version)
so my content adheres to these guidelines.
  • Loading branch information
mirnawong1 authored Oct 2, 2023
2 parents d8574d0 + ac61847 commit da0251f
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 6 deletions.
16 changes: 13 additions & 3 deletions website/docs/reference/global-configs/logs.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ The `LOG_FORMAT` config specifies how dbt's logs should be formatted. If the val
dbt --log-format json run
{"code": "A001", "data": {"v": "=1.0.0"}, "invocation_id": "1193e449-4b7a-4eb1-8e8e-047a8b3b7973", "level": "info", "log_version": 1, "msg": "Running with dbt=1.0.0", "node_info": {}, "pid": 35098, "thread_name": "MainThread", "ts": "2021-12-03T10:46:59.928217Z", "type": "log_line"}
```

</File>

<VersionBlock firstVersion="1.5">

To set the `LOG_FORMAT_FILE` type output for the file without impacting the console log format, use the `log-format-file` flag.
Expand All @@ -37,8 +40,6 @@ See [structured logging](/reference/events-logging#structured-logging) for more

:::

</File>

<VersionBlock firstVersion="1.5">

### Log Level
Expand Down Expand Up @@ -124,7 +125,16 @@ dbt --quiet run

### Color

You can set the color preferences for the file logs only using the `--use-colors-file / --no-use-colors-file` flags.
You can set the color preferences for the file logs only within `profiles.yml` or using the `--use-colors-file / --no-use-colors-file` flags.

<File name='profiles.yml'>

```yaml
config:
use_colors_file: False
```

</File>

```text
dbt --use-colors-file run
Expand Down
15 changes: 12 additions & 3 deletions website/docs/reference/global-configs/print-output.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,19 +74,28 @@ config:
use_colors: False
```

</File>

```text
dbt --use-colors run
dbt --no-use-colors run
```
<VersionBlock firstVersion="1.5">

You can set the color preferences for the file logs only using the `--use-colors-file / --no-use-colors-file` flags.
You can set the color preferences for the file logs only within `profiles.yml` or using the `--use-colors-file / --no-use-colors-file` flags.

<File name='profiles.yml'>

```yaml
config:
use_colors_file: False
```

</File>

```text
dbt --use-colors-file run
dbt --no-use-colors-file run
```

</VersionBlock>

</File>

0 comments on commit da0251f

Please sign in to comment.