From 9e15f053efd2c1979994f43e4e87a490e2c9a76b Mon Sep 17 00:00:00 2001 From: APB9785 <74077809+APB9785@users.noreply.github.com> Date: Wed, 20 Nov 2024 10:01:33 -0600 Subject: [PATCH] add logger to beacon error_handler --- lib/beacon/error_handler.ex | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/beacon/error_handler.ex b/lib/beacon/error_handler.ex index 0789f937..241c6526 100644 --- a/lib/beacon/error_handler.ex +++ b/lib/beacon/error_handler.ex @@ -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) @@ -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)