summaryrefslogtreecommitdiff
path: root/test/logger
AgeCommit message (Collapse)Author
2018-03-17Remove unused variablesk0kubun
This fixes following warning: ``` test/logger/test_logger.rb:329: warning: assigned but unused variable - read_read ``` [Fix GH-1840] From: yuuji.yaginuma <yuuji.yaginuma@gmail.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62794 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-04revert r60999usa
* test/logger/test_logdevice.rb: revert r60999 because it was caused by not committed changes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61002 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-03give a change to determine to rotate the log or notusa
* test/logger/test_logdevice.rb (test_shifting_{age,period_suffix}): give a chance to determine to rotate the log or not. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60998 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-23multiple arguments to writenobu
Make write methods of IO-like objects accept multiple arguments, as well as IO#write. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60383 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-07-20logger.rb: Fix handling prognamesonots
Because progname was memoized with ||= a logger call that involved outputting false would be nil. Example code: logger = Logger.new(STDOUT) logger.info(false) # => nil Perform an explicit nil check instead of ||= so that false will be output. patched by Gavin Miller <gavingmiller@gmail.com> [Fix GH-1667] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59380 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-16logger.rb: fix next rotate timenobu
* lib/logger.rb (Logger::LogDevice#initialize): calculate next rotate time based on the mtime of the last existing file. [ruby-dev:49881] [Bug #12948] Author: Tsukasa Oishi <tsukasa.oishi@gmail.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56815 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-16test/logger/test_logdevice.rb: heredoc stylesnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56814 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-05test_logger.rb: suppress a warningnobu
* test/logger/test_logger.rb (test_datetime_format): suppress warning when strftime called with empty format string. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56563 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-10-08logger: fix monthly log rotate with DSTnobu
* lib/logger.rb (Logger::Period#next_rotate_time): fix monthly log rotate when DST is applied during a month of 31 days. [Fix GH-1458] With DST the month of october can actually last more than 31 days. It can last 31 days plus 1 hour. So during october, `t` used to be equal to "2016-10-31 23:00:00" instead of "2016-11-01 00:00:00". This was then normalized to "2016-10-01 00:00:00" which lead every single line of log during october to rotate the log file. This fix ensure that next_rotate_time(now, 'monthly') always return the first day of next month in every situation. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56374 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-01* test/logger/test_logdevice.rb (TestLogDevice#test_shifting_period_suffix):usa
too many shifting. the last shifting created logs named as `*.3`, and they were never unlinked. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54869 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-19use more descriptive assertionsnobu
* test/logger/test_logdevice.rb: use assert_predicate, assert_not_predicate, and assert_file instead of bare assert. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54646 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-18* test/logger/test_logdevice.rb: fix tests to pass on windowssonots
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54641 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-18* lib/logger.rb: Add shift_period_suffix option [Fix GH-10772]sonots
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54639 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-18Allow specifying logger parameters in constructorsonots
* lib/logger.rb: Allow specifying logger prameters such as level, progname, datetime_format, formatter in constructor [Bug #12224] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54638 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-16Add frozen_string_literal: false for all filesnaruse
When you change this to true, you may need to add more tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-18* test/logger/test_logdevice.rb: Fix tests of logger to make it work onsonots
windows (windows can not remove opened file) [Bug #11702] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52628 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-17* lib/logger.rb: support symbol and string log level settingsonots
[fix GH-1101] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52621 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-17lib/logger.rb: Add Logger#reopensonots
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52620 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-27logger.rb: end of week should be Saturdaynobu
* lib/logger.rb (Logger::Period#previous_period_end): as weekly rotation shifts the log file on Sundays, the end date of the previous period should be Saturdays. fix r45072. [ruby-dev:49314] [Bug #11622] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52297 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-27logger.rb: fix weekly rotationnobu
* lib/logger.rb (Logger::Period#next_rotate_time): get rid of adding to mday not to exceed the days of the month. [ruby-core:71185] [Bug #11620] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52293 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-02use assert_raisenobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50727 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-13* test/lib/envutil.rb: Moved from test/ruby/.akr
* test/lib/find_executable.rb: Ditto. * test/lib/memory_status.rb: Ditto. * test/lib/test/unit.rb: require envutil. * test/: Don't require envutil in test files. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48409 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-02* logger.rb: removed unmaintain code.hsbt
[Feature #9860][ruby-core:62724] * test/logger/test_application.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46650 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-29test/logger/test_logdevice.rb: Close fds.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46229 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-22test_logdevice.rb: no utimenobu
* test/logger/test_logdevice.rb (test_shifting_midnight): do not set mtime to get rid of an error on Windows. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45099 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-22test_logdevice.rb: use assert_in_out_errnobu
* test/logger/test_logdevice.rb (test_shifting_midnight): use verbose assert_in_out_err instead of assert_ruby_status. * test/logger/test_logdevice.rb (test_shifting_dst_change): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45094 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-21test_logdevice.rb: run iff timezene supportednobu
* test/logger/test_logdevice.rb (test_shifting_dst_change): test only on platforms where timezone is supported. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45073 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-21logger.rb: DSTnobu
* lib/logger.rb (next_rotate_time, previous_period_end): consider DST change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45072 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-21logger.rb: fix midnight log rotation missnobu
* lib/logger.rb (Logger::LogDevice#check_shift_log): compare the current time with the time for the next rotation to fix rotation miss when date changed between the comparison and log writing. based on the patch by megayu <yuhg2310 AT gmail.com>. [Fixes GH-539] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45071 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-21test/logger: splitnobu
* test/logger: split for each test cases. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45070 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-16* test/net/ftp/test_ftp.rb: remove unused variables.hsbt
test/logger/test_logger.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44998 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-15test_logger.rb: fix system dependent testnobu
* test/logger/test_logger.rb (test_shifting_size_not_rotate_too_much): useless test on Windows. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44224 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-14logger.rb: fix extra log ratationnobu
* lib/logger.rb (lock_shift_log): no need to rotate the log file if it has been rotated by another process. based on the patch by no6v (Nobuhiro IMAI) in [ruby-core:58620]. [Bug #9133] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44203 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-07test_logger.rb: clear garbage filesnobu
* test/logger/test_logger.rb (test_shifting_age_in_multiprocess): unlink rotated log files all. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43577 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-02logger.rb: fix r43511 for Windowsnobu
* lib/logger.rb (Logger::LogDevice::LogDeviceMutex#lock_shift_log): open file can't be removed or renamed on Windows. [ruby-dev:47790] [Bug #9046] * test/logger/test_logger.rb (TestLogDevice#run_children): don't use fork. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43513 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-01* lib/logger.rb: Inter-process locking for log rotationnaruse
Current implementation fails log rotation on multi process env. by sonots <sonots@gmail.com> https://github.com/ruby/ruby/pull/428 fix GH-428 [Bug #9046] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43511 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-20* test/csv/test_features.rb, test/logger/test_logger.rbakr
test/mkmf/test_have_macro.rb, test/net/http/test_http.rb, test/openssl/test_config.rb, test/psych/test_encoding.rb, test/psych/test_exception.rb, test/psych/test_psych.rb, test/psych/test_tainted.rb, test/readline/test_readline.rb, test/rexml/test_contrib.rb, test/ruby/test_autoload.rb, test/ruby/test_beginendblock.rb, test/ruby/test_exception.rb, test/ruby/test_file.rb, test/ruby/test_io.rb, test/ruby/test_marshal.rb, test/ruby/test_process.rb, test/ruby/test_require.rb, test/ruby/test_rubyoptions.rb, test/syslog/test_syslog_logger.rb, test/webrick/test_httpauth.rb, test/zlib/test_zlib.rb: Use Tempfile.create. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40400 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-03-24* test/ruby/test_require.rb: Remove temporally files in the tests.akr
* test/ruby/test_rubyoptions.rb: Ditto. * test/logger/test_logger.rb: Ditto. * test/psych/test_psych.rb: Ditto. * test/readline/test_readline.rb: Ditto. * test/syslog/test_syslog_logger.rb: Ditto. * test/webrick/test_httpauth.rb: Ditto. * test/zlib/test_zlib.rb: Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39899 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-20test_logger.rb: uset tmpfilenobu
* test/logger/test_logger.rb (TestLogDevice#test_shifting_size): should not create working file in the current directory. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38887 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-06* ruby.c (load_file_internal): set default source encoding asnaruse
UTF-8 instead of US-ASCII. [ruby-core:46021] [Feature #6679] * parse.y (parser_initialize): set default parser encoding as UTF-8 instead of US-ASCII. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37485 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-08test: why believe source directories are writable always?nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35591 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-15* remove trailing spaces.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31573 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-19* test/logger/test_logger.rb: close logger (or logdevice) if it's related tousa
a file because some platforms such as Windows cannot remove opened files. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27880 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-20* test/logger/test_logger.rb (TestLogDevice#test_write): checknobu
also error message. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25424 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-20 * lib/logger.rb: imported upstream version (logger/1.2.7) see #2238.nahi
* do not raise an exception even if log writing failed. * do not raise ShiftingError if an aged file already exists. (no ShiftingError will be raised from 1.2.7, just warn() instead) * test/logger/test_logger.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25413 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-18* lib/logger.rb (ProgName): fixed for svn, based on a patch fromnobu
Nobuhiro IMAI at [ruby-dev:37108]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20245 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-24* test: assert_raises has been deprecated since a long time ago.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19536 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-23* lib/rexml/text.rb, lib/rubygems/open-uri.rb, lib/open-uri.rb,naruse
test/logger/test_logger.rb, test/ruby/test_regexp.rb: fix tests. [ruby-dev:33336] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15200 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-24* test/logger/test_logger.rb: Module#constants returns an array of Symbols.gotoyuzo
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14613 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-09-15 * test/logger/test_logger.rb: unintentionally overwritten changes bynahi
Usa. reverted. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9175 b2dd03c8-39d4-4d8f-98ff-823fe69b080e