Skip to content

Releases: adriankumpf/logger-telegram-backend

v4.0.0

Choose a tag to compare

@adriankumpf adriankumpf released this 08 Jun 13:12
v4.0.0
6b60af8

Breaking Changes

  • Require Elixir 1.15 or later
  • Validate required configuration during backend initialization and return an error when :token or :chat_id is missing

Changes

  • Require finch 0.22 or later when using the built-in HTTP client
  • Require logger_backends 1.0 or later
  • Test compatibility with Elixir 1.18 and OTP 27

Bug fixes

  • Fix message truncation to respect Telegram 4096-character message limit after HTML parsing
  • Preserve part of the message budget when truncating large metadata payloads
  • Avoid rendering an empty <pre> block when no metadata is included
  • Log send failures to stderr without emitting warning stacktrace noise
  • Fix the HTTP client test filename typo
  • Fix README and documentation typos

v3.0.0

Choose a tag to compare

@adriankumpf adriankumpf released this 12 Aug 18:58
v3.0.0
77c14e6

Breaking Changes

  • Migrate built-in HTTP from hackney to Finch
  • Replace the:adapter with the :client option
  • Remove the :proxy option

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"},
  ]
end

Adding the backend

  1. In your Application.start/2 callback, add the LoggerTelegramBackend backend:

    def start(_type, _args) do
    +  LoggerTelegramBackend.attach()
  2. Remove the :backends configuration 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)

  1. Remove the :adapter configuration

  2. Add the :client option and pass your own module that implements the LoggerTelegramBackend.HTTPClient behaviour

    config :logger, LoggerTelegramBackend,
    -  adapter: {Tesla.Adapter.Gun, []}
    +  client: MyGunAdapter

    See the documentation for LoggerTelegramBackend.HTTPClient for more information.

Proxy (optional)

  1. Remove the :proxy configuration

  2. Add the :client_pool_opts configuration

    config :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

v2.0.1

Choose a tag to compare

@adriankumpf adriankumpf released this 06 Aug 16:44
v2.0.1
ebdf096

Fixed

  • Don't crash if sending an event does not succeed

Full Changelog: v1.2.1...v2.0.1

v2.0.0

Choose a tag to compare

@adriankumpf adriankumpf released this 22 Dec 14:38

Changed

  • Use tesla to make the underlying HTTP client configurable

Breaking Changes

  • Make hackney an optional dependency. To use the default hackney based adatper, add it to the list of dependencies:

    def deps do
      [
        {:logger_telegram_backend, "~> 2.0.0"},
        {:hackney, "~> 1.17"}
      ]
    end

v1.3.0

Choose a tag to compare

@adriankumpf adriankumpf released this 22 Dec 14:38

Changed

v1.2.1

Choose a tag to compare

@adriankumpf adriankumpf released this 22 Dec 14:37

Changed

  • Bump httpoison from 1.4.0 to 1.5.1
  • Bump ex_doc from 0.19.1 to 0.20.2

v1.2.0

Choose a tag to compare

@adriankumpf adriankumpf released this 22 Dec 14:37

Added

v1.1.0

Choose a tag to compare

@adriankumpf adriankumpf released this 22 Dec 14:37

Changed

  • Remove dependency on Poison: the success of a request is now solely determined by the HTTP status code.
  • Remove GenStage and simplify the overall event handling logic
  • Update dependencies

v1.0.3

Choose a tag to compare

@adriankumpf adriankumpf released this 22 Dec 14:37

Added

  • Add @impl attributes

Changed

  • Update dependencies
  • Format code

Fixed

  • Fix typo in README

v1.0.2

Choose a tag to compare

@adriankumpf adriankumpf released this 22 Dec 14:37

Changed

  • Update httpoison to 1.0