had to conditionally handle Metaclass

This commit is contained in:
Tristan Ancelet
2026-08-25 12:39:10 -05:00
parent daa06a5acf
commit 484a1113e2
+1 -1
View File
@@ -38,7 +38,7 @@ module Logger
Log.{{level}} { [ generate_log_line, {{message}}].join(" : ") }
{% end %}
{% elsif @type %}
{% if @type.class? %}
{% if @type.class? && @type.class != Metaclass %}
{% if vars = @type.instance_vars.select(&.annotation(LogContext)) %}
Log.with_context( {% for var in vars %} {{var.name}}: @{{var.name}}, {% end %} ) do
Log.{{level}} { [ generate_log_line, {{message}}].join(" : ") }