Skip to content

Commit

Permalink
some more clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
jayamala17 committed Apr 17, 2024
1 parent 0acfeed commit 70a7a96
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
4 changes: 0 additions & 4 deletions lib/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -312,9 +312,5 @@ def self.database_config_from_env
def self.from_env
create_config(ENV.to_hash)
end

def self.log_level_from_env
CheckableData.new(ENV.to_hash).get_value(key: "SETTINGS_LOG_LEVEL", checks: [LOG_LEVEL_CHECK]).to_sym
end
end
end
13 changes: 7 additions & 6 deletions services.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def self.included(klass)
S.register(:logger) do
if !SemanticLogger::Logger.processor.appenders.console_output?
SemanticLogger.add_appender(io: S.log_stream, formatter: :color)
SemanticLogger.default_level = S.config.settings.log_level || "debug"
SemanticLogger.default_level = S.config.settings.log_level
end
end
end
Expand All @@ -42,11 +42,12 @@ def self.included(klass)

# Database Connection
S.register(:dbconnect) do
db_config = S.db_config
Sequel.connect(adapter: "mysql2",
host: S.config.database.host,
port: S.config.database.port,
database: S.config.database.database,
user: S.config.database.user,
password: S.config.database.password,
host: db_config.database.host,
port: db_config.database.port,
database: db_config.database.database,
user: db_config.database.user,
password: db_config.database.password,
fractional_seconds: true)
end

0 comments on commit 70a7a96

Please sign in to comment.