weewx-proxy/lib/weewx_proxy/application.ex

28 lines
608 B
Elixir
Raw Normal View History

2023-06-06 14:41:34 +00:00
defmodule WeewxProxy.Application do
@moduledoc false
use Application
@impl true
def start(_type, _args) do
2023-06-06 19:43:57 +00:00
_ =
case :logger.add_handlers(:systemd) do
:ok ->
:logger.remove_handler(:default)
_ ->
:logger.add_handler_filter(:default, :elixir_filter, {&:logger_filters.domain/2, {:log, :sub, [:elixir]}})
end
2023-06-06 14:41:34 +00:00
children = [
WeewxProxy.Mqtt,
WeewxProxy.Publisher,
2023-06-06 19:12:49 +00:00
WeewxProxy.Http,
:systemd.ready()
2023-06-06 14:41:34 +00:00
]
opts = [strategy: :one_for_one, name: WeewxProxy.Supervisor]
Supervisor.start_link(children, opts)
end
end