lib/rocket_job/cli.rb in rocketjob-3.0.0.rc3 vs lib/rocket_job/cli.rb in rocketjob-3.0.0.rc4
- old
+ new
@@ -1,7 +1,8 @@
require 'optparse'
require 'semantic_logger'
+require 'mongoid'
module RocketJob
# Command Line Interface parser for RocketJob
class CLI
include SemanticLogger::Loggable
attr_accessor :name, :workers, :environment, :pidfile, :directory, :quiet,
@@ -120,9 +121,12 @@
SemanticLogger.add_appender(io: STDOUT, formatter: :color) unless quiet
SemanticLogger.default_level = log_level.to_sym if log_level
# Enable SemanticLogger signal handling for this process
SemanticLogger.add_signal_handler
+
+ Mongoid.logger = SemanticLogger[Mongoid]
+ Mongo::Logger.logger = SemanticLogger[Mongo]
end
# Eager load files in jobs folder
def self.eager_load_jobs(path = 'jobs')
Pathname.glob("#{path}/**/*.rb").each do |path|