Skip to content

Commit

Permalink
Drop the raw_create_* logger methods
Browse files Browse the repository at this point in the history
  • Loading branch information
agrare committed Nov 28, 2023
1 parent 86b127a commit b8aabc6
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions lib/vmdb/loggers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,35 +56,25 @@ def self.create_logger(log_file_name, logger_class = ManageIQ::Loggers::Base)
end

private_class_method def self.create_container_logger(log_file_name, logger_class)
return nil unless (logger = create_raw_container_logger)
require "manageiq/loggers/container"
logger = ManageIQ::Loggers::Container.new

progname = progname_from_file(log_file_name)
logger.progname = progname

create_wrapper_logger(progname, logger_class, logger)
end

private_class_method def self.create_raw_container_logger
require "manageiq/loggers/container"
ManageIQ::Loggers::Container.new
end

private_class_method def self.create_journald_logger(log_file_name, logger_class)
return nil unless (logger = create_raw_journald_logger)
require "manageiq/loggers/journald"
logger = ManageIQ::Loggers::Journald.new

progname = progname_from_file(log_file_name)
logger.progname = progname

create_wrapper_logger(progname, logger_class, logger)
end

private_class_method def self.create_raw_journald_logger
require "manageiq/loggers/journald"
ManageIQ::Loggers::Journald.new
rescue LoadError
nil
end

private_class_method def self.log_path_from_file(log_file)
log_file = Pathname.new(log_file) if log_file.kind_of?(String)
log_file = ManageIQ.root.join("log", log_file) if log_file.try(:dirname).to_s == "."
Expand Down

0 comments on commit b8aabc6

Please sign in to comment.