diff options
author | Jordan Bracco <href@random.sh> | 2022-12-17 13:01:29 +0000 |
---|---|---|
committer | Jordan Bracco <href@random.sh> | 2022-12-20 19:29:41 +0100 |
commit | 4b81c028885a53806dd5592f89b845e1f764c41e (patch) | |
tree | 04ec2ea4b7502a76b82d9314d373c266e506926d /lib/lsg_irc | |
parent | feat(couch): convert slashes to %2F in paths, allowing to use database or doc... (diff) |
Rename to Nola, pt. 1. Refs T77
Diffstat (limited to '')
-rw-r--r-- | lib/lsg_irc/logger_plugin.ex | 1 | ||||
-rw-r--r-- | lib/lsg_irc/lsg_irc.ex | 13 |
2 files changed, 6 insertions, 8 deletions
diff --git a/lib/lsg_irc/logger_plugin.ex b/lib/lsg_irc/logger_plugin.ex index e5307bc..de601a6 100644 --- a/lib/lsg_irc/logger_plugin.ex +++ b/lib/lsg_irc/logger_plugin.ex @@ -13,6 +13,7 @@ defmodule LSG.IRC.LoggerPlugin do regopts = [plugin: __MODULE__] {:ok, _} = Registry.register(IRC.PubSub, "triggers", regopts) {:ok, _} = Registry.register(IRC.PubSub, "messages", regopts) + {:ok, _} = Registry.register(IRC.PubSub, "irc:outputs", regopts) {:ok, _} = Registry.register(IRC.PubSub, "messages:private", regopts) {:ok, nil} end diff --git a/lib/lsg_irc/lsg_irc.ex b/lib/lsg_irc/lsg_irc.ex index c2782ad..a50abed 100644 --- a/lib/lsg_irc/lsg_irc.ex +++ b/lib/lsg_irc/lsg_irc.ex @@ -1,17 +1,15 @@ defmodule LSG.IRC do require Logger + def env(), do: LSG.env(:irc) + def env(key, default \\ nil), do: Keyword.get(env(), key, default) def application_childs do - env = Application.get_env(:lsg, :irc) import Supervisor.Spec IRC.Connection.setup() IRC.Plugin.setup() - # Probably just needed for migration - #for plugin <- Application.get_env(:lsg, :irc)[:plugins], do: IRC.Plugin.declare(plugin) - [ worker(Registry, [[keys: :duplicate, name: IRC.ConnectionPubSub]], id: :registr_irc_conn), worker(Registry, [[keys: :duplicate, name: IRC.PubSub]], id: :registry_irc), @@ -25,13 +23,12 @@ defmodule LSG.IRC do ] end + # Start plugins first to let them get on connection events. def after_start() do - # Start plugins first to let them get on connection events. - Logger.debug("IRC.after_start - initializing plugins") + Logger.info("Starting plugins") IRC.Plugin.start_all() - Logger.debug("IRC.after_start - initializing connections") + Logger.info("Starting connections") IRC.Connection.start_all() - Logger.debug("IRC.after_start - ok") end end |