Skip to content

Commit

Permalink
chore: use semantic logger for console
Browse files Browse the repository at this point in the history
  • Loading branch information
bethesque committed Apr 2, 2024
1 parent 637c25f commit dfa457a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions script/dev/console.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Bundler.require

require "sequel"
require "logger"
require "semantic_logger"
require "fileutils"
require "pact_broker/initializers/database_connection"

Expand All @@ -24,13 +24,14 @@
FileUtils.mkdir_p(File.absolute_path(File.dirname(URI(database_connection_string).path)))
end

logger = Logger.new($stdout)
logger.level = Logger::DEBUG
SemanticLogger.default_level = :info
SemanticLogger.add_appender(io: $stdout)
logger = SemanticLogger["console"]

database_opts = {
logger: logger,
encoding: "utf8",
sql_log_level: "debug"
sql_log_level: "trace"
}

puts "Connecting to #{database_connection_string}"
Expand Down

0 comments on commit dfa457a

Please sign in to comment.