Skip to content

Commit

Permalink
logs fix
Browse files Browse the repository at this point in the history
  • Loading branch information
snichme committed Oct 10, 2024
1 parent 2b9faf2 commit c4dd8ab
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/lavinmq/config.cr
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ require "./in_memory_backend"

module LavinMQ
class Config
DEFAULT_LOG_LEVEL = Log::Severity::Info
DEFAULT_LOG_LEVEL = ::Log::Severity::Info

property data_dir : String = ENV.fetch("STATE_DIRECTORY", "/var/lib/lavinmq")
property config_file = File.exists?(File.join(ENV.fetch("CONFIGURATION_DIRECTORY", "/etc/lavinmq"), "lavinmq.ini")) ? File.join(ENV.fetch("CONFIGURATION_DIRECTORY", "/etc/lavinmq"), "lavinmq.ini") : ""
property log_file : String? = nil
property log_level : Log::Severity = DEFAULT_LOG_LEVEL
property log_level : ::Log::Severity = DEFAULT_LOG_LEVEL
property amqp_bind = "127.0.0.1"
property amqp_port = 5672
property amqps_port = -1
Expand Down Expand Up @@ -109,12 +109,12 @@ module LavinMQ
p.on("--ciphers CIPHERS", "List of TLS ciphers to allow") { |v| @tls_ciphers = v }
p.on("--tls-min-version=VERSION", "Mininum allowed TLS version (default 1.2)") { |v| @tls_min_version = v }
p.on("-l", "--log-level=LEVEL", "Log level (Default: info)") do |v|
level = Log::Severity.parse?(v.to_s)
level = ::Log::Severity.parse?(v.to_s)
@log_level = level if level
end
p.on("--raise-gc-warn", "Raise on GC warnings") { @raise_gc_warn = true }
p.on("--no-data-dir-lock", "Don't put a file lock in the data directory (default true)") { @data_dir_lock = false }
p.on("-d", "--debug", "Verbose logging") { @log_level = Log::Severity::Debug }
p.on("-d", "--debug", "Verbose logging") { @log_level = ::Log::Severity::Debug }
p.on("-h", "--help", "Show this help") { puts p; exit 1 }
p.on("-v", "--version", "Show version") { puts LavinMQ::VERSION; exit 0 }
p.on("--build-info", "Show build information") { puts LavinMQ::BUILD_INFO; exit 0 }
Expand Down Expand Up @@ -211,7 +211,7 @@ module LavinMQ
case config
when "data_dir" then @data_dir = v
when "data_dir_lock" then @data_dir_lock = true?(v)
when "log_level" then @log_level = Log::Severity.parse(v)
when "log_level" then @log_level = ::Log::Severity.parse(v)
when "log_file" then @log_file = v
when "stats_interval" then @stats_interval = v.to_i32
when "stats_log_size" then @stats_log_size = v.to_i32
Expand Down

0 comments on commit c4dd8ab

Please sign in to comment.