From: <hs...@us...> - 2008-06-15 10:05:40
|
Revision: 3288 http://tdiary.svn.sourceforge.net/tdiary/?rev=3288&view=rev Author: hsbt Date: 2008-06-15 03:05:46 -0700 (Sun, 15 Jun 2008) Log Message: ----------- merge from r3287. Modified Paths: -------------- branches/Test_SelectFilter/core/ChangeLog branches/Test_SelectFilter/core/plugin/10spamfilter.rb branches/Test_SelectFilter/core/plugin/en/10spamfilter.rb branches/Test_SelectFilter/core/plugin/ja/10spamfilter.rb branches/Test_SelectFilter/core/plugin/zh/10spamfilter.rb branches/Test_SelectFilter/core/tdiary.rb Modified: branches/Test_SelectFilter/core/ChangeLog =================================================================== --- branches/Test_SelectFilter/core/ChangeLog 2008-06-15 10:00:46 UTC (rev 3287) +++ branches/Test_SelectFilter/core/ChangeLog 2008-06-15 10:05:46 UTC (rev 3288) @@ -1,3 +1,9 @@ +2008-06-15 SHIBATA Hiroshi <shi...@gm...> + * tdiary.rb: integrate logger and spamfilter debug log. + +2008-06-15 SHIBATA Hiroshi <shi...@gm...> + * tdiary.rb: changed logger path option. + 2008-06-09 TADA Tadashi <sh...@sp...> * self converting to UTF-8. thanks kazuhiko. * tdiary/lang/*.rb: added migrate_to_utf8 method. Modified: branches/Test_SelectFilter/core/plugin/10spamfilter.rb =================================================================== --- branches/Test_SelectFilter/core/plugin/10spamfilter.rb 2008-06-15 10:00:46 UTC (rev 3287) +++ branches/Test_SelectFilter/core/plugin/10spamfilter.rb 2008-06-15 10:05:46 UTC (rev 3288) @@ -89,12 +89,6 @@ else @conf['filter.debug_mode'] = 0 end - - if @cgi.params['filter.debug_file'] && @cgi.params['filter.debug_file'][0] - @conf['filter.debug_file'] = @cgi.params['filter.debug_file'][0] - else - @conf['filter.debug_file'] = nil - end end if @cgi.params['spamfilter.date_limit'] && Modified: branches/Test_SelectFilter/core/plugin/en/10spamfilter.rb =================================================================== --- branches/Test_SelectFilter/core/plugin/en/10spamfilter.rb 2008-06-15 10:00:46 UTC (rev 3287) +++ branches/Test_SelectFilter/core/plugin/en/10spamfilter.rb 2008-06-15 10:05:46 UTC (rev 3288) @@ -71,8 +71,6 @@ <option value="1"#{" selected" if @conf['filter.debug_mode'] == 1}>Only spam</option> <option value="2"#{" selected" if @conf['filter.debug_mode'] == 2}>Full</option> </select></p> - <p>File name of debug log.<br> - <input type="text" name="spamfilter.debug_file" value="#{h( @conf['filter.debug_file'] || '' )}" size="30"></p> HTML end Modified: branches/Test_SelectFilter/core/plugin/ja/10spamfilter.rb =================================================================== --- branches/Test_SelectFilter/core/plugin/ja/10spamfilter.rb 2008-06-15 10:00:46 UTC (rev 3287) +++ branches/Test_SelectFilter/core/plugin/ja/10spamfilter.rb 2008-06-15 10:05:46 UTC (rev 3288) @@ -64,13 +64,12 @@ unless @conf.secure then r << <<-HTML <h3>フィルタのログ</h3> - <p>フィルタのログを以下のファイルに + <p>フィルタのログを <select name="filter.debug_mode"> <option value="0"#{" selected" if @conf['filter.debug_mode'] == 0}>記録しない</option> <option value="1"#{" selected" if @conf['filter.debug_mode'] == 1}>spamだけ記録する</option> <option value="2"#{" selected" if @conf['filter.debug_mode'] == 2}>すべて記録する</option> </select></p> - <p>ファイル名: <input type="text" name="filter.debug_file" value="#{h( @conf['filter.debug_file'] || '' )}" size="50"></p> HTML end Modified: branches/Test_SelectFilter/core/plugin/zh/10spamfilter.rb =================================================================== --- branches/Test_SelectFilter/core/plugin/zh/10spamfilter.rb 2008-06-15 10:00:46 UTC (rev 3287) +++ branches/Test_SelectFilter/core/plugin/zh/10spamfilter.rb 2008-06-15 10:05:46 UTC (rev 3288) @@ -71,8 +71,6 @@ <option value="1"#{" selected" if @conf['filter.debug_mode'] == 1}>Only spam</option> <option value="2"#{" selected" if @conf['filter.debug_mode'] == 2}>Full</option> </select></p> - <p>File name of debug log.<br> - <input type="text" name="spamfilter.debug_file" value="#{h( @conf['filter.debug_file'] || '' )}" size="30"></p> HTML end Modified: branches/Test_SelectFilter/core/tdiary.rb =================================================================== --- branches/Test_SelectFilter/core/tdiary.rb 2008-06-15 10:00:46 UTC (rev 3287) +++ branches/Test_SelectFilter/core/tdiary.rb 2008-06-15 10:05:46 UTC (rev 3288) @@ -7,7 +7,7 @@ You can redistribute it and/or modify it under GPL2. =end -TDIARY_VERSION = '2.3.0.20080609' +TDIARY_VERSION = '2.3.0.20080615' $:.insert( 1, File::dirname( __FILE__ ) + '/misc/lib' ) @@ -311,12 +311,6 @@ else @debug_mode = DEBUG_NONE end - - if @conf.options.include?('filter.debug_file') - @debug_file = @conf.options['filter.debug_file'] - else - @debug_file = nil - end end def comment_filter( diary, comment ) @@ -331,11 +325,7 @@ return if @debug_mode == DEBUG_NONE return if @debug_mode == DEBUG_SPAM and level == DEBUG_FULL - require 'time' - File.open( @debug_file, 'a' ) do |io| - io.flock(File::LOCK_EX) - io.puts "#{Time.now.iso8601}: #{@cgi.remote_addr}->#{(@cgi.params['date'][0] || 'no date').dump}: #{msg}" - end + @conf.debug("#{@cgi.remote_addr}->#{(@cgi.params['date'][0] || 'no date').dump}: #{msg}") end end end @@ -483,7 +473,7 @@ @bot = Regexp::new( "(#{bot.uniq.join( '|' )})", true ) require 'logger' - log_path = @options['logger'] || "#{@data_path}/log/" + log_path = @options['log_path'] || "#{@data_path}/log/" unless FileTest::directory?( log_path ) then begin Dir::mkdir( log_path ) @@ -492,7 +482,6 @@ end log_file = log_path + "debug.log" @logger = Logger::new( log_file, 'weekly' ) - end # saving to tdiary.conf in @data_path This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |