Skip to content

Commit

Permalink
feat: supports metadata coming from any caller
Browse files Browse the repository at this point in the history
  • Loading branch information
grzuy committed Aug 2, 2024
1 parent 2088324 commit d3c4980
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions lib/tower/event.ex
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ defmodule Tower.Event do
kind: :error,
reason: exception,
stacktrace: stacktrace,
metadata: %{
log_event: log_event
}
metadata:
%{log_event: log_event}
|> Map.merge(Keyword.get(options, :metadata, %{}))
}
end

Expand All @@ -67,9 +67,9 @@ defmodule Tower.Event do
kind: :exit,
reason: reason,
stacktrace: stacktrace,
metadata: %{
log_event: log_event
}
metadata:
%{log_event: log_event}
|> Map.merge(Keyword.get(options, :metadata, %{}))
}
end

Expand All @@ -85,9 +85,9 @@ defmodule Tower.Event do
kind: :throw,
reason: reason,
stacktrace: stacktrace,
metadata: %{
log_event: log_event
}
metadata:
%{log_event: log_event}
|> Map.merge(Keyword.get(options, :metadata, %{}))
}
end

Expand All @@ -102,9 +102,9 @@ defmodule Tower.Event do
level: level,
kind: :message,
reason: message,
metadata: %{
log_event: log_event
}
metadata:
%{log_event: log_event}
|> Map.merge(Keyword.get(options, :metadata, %{}))
}
end

Expand Down

0 comments on commit d3c4980

Please sign in to comment.