lib/legion/logging/logger.rb in legion-logging-0.3.1 vs lib/legion/logging/logger.rb in legion-logging-1.0.0

- old
+ new

@@ -2,19 +2,22 @@ require 'legion/logging/builder' module Legion module Logging class Logger - attr_reader :log, :color + attr_accessor :log, :color, :level, :lex, :log_file, :trace_enabled, :extended include Legion::Logging::Methods include Legion::Logging::Builder - def initialize(options = {}) - output(options) - log_level(options[:level]) - log_format(options) - @color = options[:color] - @color = true if options[:color].nil? && options[:log_file].nil? + def initialize(level: 'info', log_file: nil, lex: nil, trace: false, extended: false, trace_size: 4, **opts) # rubocop:disable Metrics/ParameterLists + output(logfile: log_file) + log_level(level) + log_format(lex: lex, extended: extended, **opts) + @color = opts[:color] + @color = true if opts[:color].nil? && log_file.nil? + @trace_enabled = trace + @trace_size = trace_size + @extended = extended end end end end