class SvelteOnRails::Lib::Utils

def self.puts_error(text)

Defining methods to log errors and warnings using Rails logger
def self.puts_error(text)
  # Using Rails logger to log error with custom formatting
  caller_info = caller[1] =~ /`([^']*)'/ ? $1 : "unknown"
  Rails.logger.error("  => [svelte-on-rails] #{caller_info} ERROR")
  text.split("\n").each do |line|
    Rails.logger.error("  => #{line}")
  end
end