Skip to content

Commit

Permalink
add logger to beacon error_handler
Browse files Browse the repository at this point in the history
  • Loading branch information
APB9785 committed Nov 20, 2024
1 parent 49c4a95 commit 9e15f05
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/beacon/error_handler.ex
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ defmodule Beacon.ErrorHandler do

alias Beacon.Loader

require Logger

def undefined_function(module, fun, args) do
ensure_loaded(module) or load_resource(module)
:error_handler.undefined_function(module, fun, args)
Expand Down Expand Up @@ -51,6 +53,9 @@ defmodule Beacon.ErrorHandler do
defp load_beacon_resource(nil = _site, _resource), do: false

defp load_beacon_resource(site, resource) do
# TODO eventually replace Logger with Beacon telemetry
Logger.debug("#{__MODULE__} loading #{resource} for #{site}")

case resource do
"Page" <> page_id -> Loader.load_page_module(site, page_id)
"Layout" <> layout_id -> Loader.load_layout_module(site, layout_id)
Expand Down

0 comments on commit 9e15f05

Please sign in to comment.