diff --git a/spec/spec_helper.cr b/spec/spec_helper.cr index 5b9f844c0..d8ee0bc9f 100644 --- a/spec/spec_helper.cr +++ b/spec/spec_helper.cr @@ -19,6 +19,8 @@ backend = Log::IOBackend.new(STDERR) backend.formatter = Dexter::JSONLogFormatter.proc Log.builder.bind("avram.*", :error, backend) +Avram.initialize_logging + Db::Create.new(quiet: true).run_task Db::Migrate.new(quiet: true).run_task Db::VerifyConnection.new(quiet: true).run_task diff --git a/src/avram.cr b/src/avram.cr index fed8b68f0..9e59b0987 100644 --- a/src/avram.cr +++ b/src/avram.cr @@ -38,6 +38,9 @@ module Avram alias TableName = String | Symbol + # This subscribes to several `Pulsar` events. + # These events are triggered during query and + # operation events def self.initialize_logging Avram::Events::QueryEvent.subscribe do |event, duration| next if event.query.starts_with?("TRUNCATE") @@ -85,5 +88,3 @@ module Avram end end end - -Avram.initialize_logging