Skip to content
This repository was archived by the owner on May 26, 2024. It is now read-only.

Feat: Add verbosity setting documentation #47

Merged
merged 1 commit into from
Mar 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions src/pages/docs/latest/configuration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,42 @@ from thread import Settings
</ArgumentBody>
</ArgumentWrapper>

<ArgumentWrapper>
<summary>
<strong className='text-lg'>
VERBOSITY
<ArgumentExtra>VerbosityLevel</ArgumentExtra>
<ArgumentExtra>(default: 'normal')</ArgumentExtra>
</strong>
</summary>
<ArgumentBody>
Adjust what is printed to the terminal.
<Callout type='info'>
This feature is only available in `thread ^v1.0.1`
</Callout>

Simply invoke `Setting.set_verbosity(level)` to set the verbosity level.
```py
from thread import Settings

Settings.set_verbosity(1)
Settings.set_verbosity('normal')
```

`Settings.VERBOSITY` can be compared against strings and integers and other `Verbosity` objects.
```py
from thread.utils.config import Verbosity, Settings

# Mapping
Verbosity(0) == Verbosity('quiet')
Verbosity(1) == Verbosity('normal')
Verbosity(2) == Verbosity('verbose')

# Comparison
Verbosity(0) < 1 # True
Verbosity(1) < 'verbose' # True
Verbosity(2) == 'verbose' # True
```
</ArgumentBody>
</ArgumentWrapper>