Added configurable logging level

This commit is contained in:
Kiran Shila
2022-01-12 12:56:20 -08:00
parent 1181ff574c
commit 3e556f5cc3
3 changed files with 7 additions and 4 deletions

View File

@@ -141,13 +141,14 @@ To skip the build, just download `Doplarr.jar` and `config.edn` from the release
| Environment Variable (Docker) | Config File Keyword | Type | Default Value | Description |
| ----------------------------- | -------------------------- | ------- | ------------- | --------------------------------------------------------------------------------------------------- |
| `DISCORD__MAX_RESULTS` | `:discord/max-results` | Integer | 25 | Sets the maximum size of the search results selection |
| `DISCORD__MAX_RESULTS` | `:discord/max-results` | Integer | `25` | Sets the maximum size of the search results selection |
| `DISCORD__ROLE_ID` | `:discord/role-id` | String | N/A | The discord role id for users of the bot (omitting this lets everyone on the server use the bot) |
| `PARTIAL_SEASONS` | `:partial-seasons` | Boolean | True | Sets whether users can request partial seasons. |
| `SONARR__QUALITY_PROFILE` | `:sonarr/quality-profile` | String | N/A | The name of the quality profile to use by default for Sonarr |
| `RADARR__QUALITY_PROFILE` | `:radarr/quality-profile` | String | N/A | The name of the quality profile to use by default for Radarr |
| `SONARR__LANGUAGE_PROFILE` | `:sonarr/language-profile` | String | N/A | The name of the language profile to use by default for Radarr |
| `OVERSEERR__DEFAULT_ID` | `:overseerr/default-id` | Integer | N/A | The Overseerr user id to use by default if there is no associated discord account for the requester |
| `PARTIAL_SEASONS` | `:partial-seasons` | Boolean | `true` | Sets whether users can request partial seasons. |
| `LOG_LEVEL` | `:log-level` | Keyword | `:info` | The log level for the logging backend. This can be changed for debugging purposes. |
### Setting up on Windows

View File

@@ -19,6 +19,7 @@
(spec/def :discord/token string?)
; --- Optional settings
(spec/def ::log-level keyword?)
(spec/def :discord/role-id string?)
(spec/def :discord/max-results #(and (pos-int? %)
(<= % 25)))
@@ -47,7 +48,8 @@
; Complete configuration
(spec/def ::config (spec/and
(spec/keys :req [:discord/token]
:opt [:discord/role-id
:opt [::log-level
:discord/role-id
:discord/max-results
:radarr/quality-profile
:sonarr/quality-profile

View File

@@ -16,7 +16,7 @@
; Pipe tools.logging to timbre
(tlog/use-timbre)
(timbre/merge-config! {:min-level [[#{"*"} :info]]})
(timbre/merge-config! {:min-level [[#{"*"} (:log-level env :info)]]})
; Multimethod for handling incoming Discord events
(defmulti handle-event!