v3.0.0
Breaking Changes
- Migrate built-in HTTP from
hackneytoFinch - Replace the
:adapterwith the:clientoption - Remove the
:proxyoption
Changes
- Log a warning if sending fails
- Allow messages to be filtered by a metadata key
Bug fixes
- Escape metadata fields when sending messages
- Fix deprecation warnings on Elixir 1.15
Upgrade Instructions
Dependencies
Add :finch to your list of dependencies in mix.exs:
def deps do
[
{:logger_telegram_backend, "~> 3.0"},
{:finch, "~> 0.16"},
]
endAdding the backend
-
In your
Application.start/2callback, add theLoggerTelegramBackendbackend:def start(_type, _args) do + LoggerTelegramBackend.attach() -
Remove the
:backendsconfiguration from:logger:config :logger, - backends: [LoggerTelegramBackend, :console]
Config
Configuration is now done via the LoggerTelegramBackend key:
- config :logger, :telegram,
+ config :logger, LoggerTelegramBackend,
# ...HTTP client (optional)
-
Remove the
:adapterconfiguration -
Add the
:clientoption and pass your own module that implements theLoggerTelegramBackend.HTTPClientbehaviourconfig :logger, LoggerTelegramBackend, - adapter: {Tesla.Adapter.Gun, []} + client: MyGunAdapter
See the documentation for
LoggerTelegramBackend.HTTPClientfor more information.
Proxy (optional)
-
Remove the
:proxyconfiguration -
Add the
:client_pool_optsconfigurationconfig :logger, LoggerTelegramBackend, - proxy: "socks5://127.0.0.1:9050" + client_pool_opts: [conn_opts: [proxy: {:http, "127.0.0.1", 9050, []}]]
See Pool Configuration Options for further information.
Full Changelog: v2.0.1...v3.0.0