From 607cbd4069a0b47c9a5be743ebc6a564bece21dc Mon Sep 17 00:00:00 2001 From: Steve Kemp Date: Wed, 4 Mar 2015 11:59:59 +0000 Subject: Don't use a logger. Instead we run quietly if nothing was output, and run verbosely if we see "--verbose". --- etc/custodian/custodian.cfg | 7 ------- lib/custodian/worker.rb | 25 ++----------------------- 2 files changed, 2 insertions(+), 30 deletions(-) diff --git a/etc/custodian/custodian.cfg b/etc/custodian/custodian.cfg index e202f9a..8870250 100644 --- a/etc/custodian/custodian.cfg +++ b/etc/custodian/custodian.cfg @@ -52,13 +52,6 @@ -## -# The log-file to use for the worker -# -# log_file = custodian-dequeue.log -## - - ## # # The number of times to repeat a test before regarding it diff --git a/lib/custodian/worker.rb b/lib/custodian/worker.rb index e036168..c11ae71 100644 --- a/lib/custodian/worker.rb +++ b/lib/custodian/worker.rb @@ -1,12 +1,4 @@ - -# -# Standard modules -# -require 'logger' - - - # # Our modules. # @@ -60,12 +52,6 @@ module Custodian attr_reader :retry_delay - # - # The log-file object - # - attr_reader :logger - - # # The settings from the global configuration file # @@ -87,10 +73,6 @@ module Custodian # Get the alerter-type(s) to instantiate @alerter = settings.alerter - # Instantiate the logger. - logfile = settings.log_file - @logger = Logger.new( logfile, "daily" ) - # Save the settings @settings = settings @@ -106,11 +88,10 @@ module Custodian # - # Write the given message to our logfile - and show it to the console too. + # Show to the console if "--verbose" was specified. # def log_message( msg ) - @logger.info( msg ) - puts msg + puts msg if ( ENV["VERBOSE" ] ) end @@ -121,8 +102,6 @@ module Custodian # def run! while( true ) - log_message( "\n" ) - log_message( "\n" ) log_message( "Waiting for job.." ) process_single_job() end -- cgit v1.2.1