Logging
Apart from usual Logger
configuration, logging in Membrane can be additionally configured, also via Elixir's Config
. It allows to enable verbose mode and customize metadata, for example:
config :membrane_core, :logger, verbose: true
See Membrane.Logger
for details.
Moreover, pipelines support Membrane.Pipeline.Action.log_metadata_t/0
, that enables setting logger metadata to all descendants of a pipeline, for example:
@impl true
def handle_init(opts) do
# ...
{{:ok, log_metadata: [pipeline_id: opts.id]}, state}
end
To have the metadata displayed, remember to enable that in the logger backend, for example:
config :logger, :console, metadata: [:pipeline_id]
The log_metadata
action is also available in bins: Membrane.Bin.Action.log_metadata_t/0
.