adriankumpf / logger-telegram-backend Goto Github PK
View Code? Open in Web Editor NEWA logger backend for Telegram
Home Page: https://hex.pm/packages/logger_telegram_backend
License: MIT License
A logger backend for Telegram
Home Page: https://hex.pm/packages/logger_telegram_backend
License: MIT License
I'm a bit puzzled about this: if I release an app with mix distillery.release
and start it with _build/dev/rel/testapp/bin/testapp console
, Logger.error("test")
will correctly result in the bot sending a message. If I connect to the very same app by _build/dev/rel/testapp/bin/testapp remote_console
, Logger.error("test")
will result in an error:
[error] GenServer #PID<0.107.0> terminating
** (stop) {:EXIT, {{:badmatch, {:error, %Mint.TransportError{reason: :ssl_not_started}}}, [{LoggerTelegramBackend, :handle_event, 2, [file: 'lib/telegram_logger_backend.ex', line: 47]}, {:gen_event, :server_update, 4, [file: 'gen_event.erl', line: 577]}, {:gen_event, :server_notify, 4, [file: 'gen_event.erl', line: 559]}, {:gen_event, :handle_msg, 6, [file: 'gen_event.erl', line: 300]}, {:proc_lib, :init_p_do_apply, 3, [file: 'proc_lib.erl', line: 249]}]}}
Last message: {:gen_event_EXIT, LoggerTelegramBackend, {:EXIT, {{:badmatch, {:error, %Mint.TransportError{reason: :ssl_not_started}}}, [{LoggerTelegramBackend, :handle_event, 2, [file: 'lib/telegram_logger_backend.ex', line: 47]}, {:gen_event, :server_update, 4, [file: 'gen_event.erl', line: 577]}, {:gen_event, :server_notify, 4, [file: 'gen_event.erl', line: 559]}, {:gen_event, :handle_msg, 6, [file: 'gen_event.erl', line: 300]}, {:proc_lib, :init_p_do_apply, 3, [file: 'proc_lib.erl', line: 249]}]}}}
I tried to add :ssl
to the extra_applications, to no avail. What could be the cause of such a behavior?
I attached a minimal app to test, just mix distillery.release
and run it as I explained above
Thanks!
In lib/telegram_logger_backend.ex:47 the match :ok = log_event(level, message, timestamp, metadata, state)
can end up in the GenServer terminating in case the returned value is, for example, {:error, reason}
instead of :ok
, which is not necessarily bad, if I understand well how Mint works (also see elixir-mint/mint#211). Would it make sense to ignore the returned value?
Thanks
I think I need a little help with the configuration:
In config.ex
, I have:
adapter: {Tesla.Adapter.Finch, name: LoggerTelegramBackend.Finch}
in application.ex
:
{Finch, name: LoggerTelegramBackend.Finch}
is one of the children
but when I start the app, I get:
[error] :gen_event handler LoggerTelegramBackend installed in Logger terminating
** (ArgumentError) unknown registry: LoggerTelegramBackend.Finch
what am I missing?
Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.