File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,10 +11,9 @@ class Harvest
1111 def initialize ( *args )
1212 orig_init ( *args )
1313 @summary = [ ]
14- @logger = Logger . new ( File . join ( @config . logfile , "harvester.log" ) ,
15- shift_age = 'weekly' ) if @config . logfile
14+ @logger = @config . logfile ? Logger . new ( File . join ( @config . logfile , "harvester.log" ) , 'weekly' ) : Logger . new ( STDOUT )
1615 @logger . datetime_format = "%Y-%m-%d %H:%M"
17-
16+
1817 # Turn off logging if no logging directory is specified.
1918 @logger . level = Logger ::FATAL unless @config . logfile
2019 end
@@ -25,7 +24,7 @@ def start(sites = nil, interactive = false)
2524 orig_start ( sites )
2625 begin
2726 OAI ::Harvester ::
28- Mailer . send ( @config . mail_server , @config . email , @summary )
27+ Mailer . send ( @config . mail_server , @config . email , @summary ) if @config . email
2928 rescue
3029 @logger . error { "Error sending out summary email: #{ $!} " }
3130 end
You can’t perform that action at this time.
0 commit comments