File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -87,6 +87,7 @@ defmodule ExICE.ICEAgent do
8787 * `on_data` - where to send data. Defaults to a process that spawns `ExICE`.
8888 * `on_new_candidate` - where to send new candidates. Defaults to a process that spawns `ExICE`.
8989 * `host_to_srflx_ip_mapper` - function called for each host candidate to derive a new "fabricated" srflx candidate from it.
90+ * `logger_metadata` - a keyword list of metadata to be attached to the Logger for all logs emitted by the ICEAgent process.
9091 This function takes host's ip as an argument and should return srflx's ip as a result or nil if for given host candidate
9192 there should be no srflx one.
9293 """
@@ -107,7 +108,8 @@ defmodule ExICE.ICEAgent do
107108 on_connection_state_change: pid ( ) | nil ,
108109 on_data: pid ( ) | nil ,
109110 on_new_candidate: pid ( ) | nil ,
110- host_to_srflx_ip_mapper: host_to_srflx_ip_mapper ( ) | nil
111+ host_to_srflx_ip_mapper: host_to_srflx_ip_mapper ( ) | nil ,
112+ logger_metadata: Enumerable . t ( { atom ( ) , term ( ) } )
111113 ]
112114
113115 @ doc """
@@ -321,6 +323,8 @@ defmodule ExICE.ICEAgent do
321323
322324 @ impl true
323325 def init ( opts ) do
326+ if Keyword . has_key? ( opts , :logger_metadata ) , do: Logger . metadata ( opts [ :logger_metadata ] )
327+
324328 ice_agent = ExICE.Priv.ICEAgent . new ( opts )
325329 { :ok , % { ice_agent: ice_agent , pending_eoc: false , pending_remote_cands: MapSet . new ( ) } }
326330 end
You can’t perform that action at this time.
0 commit comments