summaryrefslogtreecommitdiff
path: root/test/logger
AgeCommit message (Collapse)Author
2019-12-10Followed up 38722fa179fcec549300b2f35206f4eb168f202eHiroshi SHIBATA
2019-12-10[ruby/logger] Enable more timezone tests on OpenBSDJeremy Evans
https://github.com/ruby/logger/commit/bcd7e227e8
2019-12-10[ruby/logger] Raise ArgumentError for invalid shift_ageJeremy Evans
Consider 'now' and 'everytime' as valid values for the previous behavior of rotating everytime. Fixes Ruby Bug 15977 https://github.com/ruby/logger/commit/f92979a376
2019-12-10[ruby/logger] Honor Logger#level overridesGeorge Claghorn
https://github.com/ruby/logger/commit/7365c995bf
2019-12-09Added workaround for CoreAssertions used by ruby/logger.Hiroshi SHIBATA
2019-12-09Merge the upstream changes for test-unit on ruby/logger.Hiroshi SHIBATA
This commits are based with: https://github.com/ruby/logger/commit/f067f7d1aa743b467d633ec6d1790bd93ed9e25b https://github.com/ruby/logger/commit/86058f420d8f6909500cccceb24f58bef0597b4d https://github.com/ruby/logger/commit/02db6e8ed85d1f4ba974f08fee292bad400d9fc2
2019-09-06Fix keyword argument warnings in the tests from Class#newJeremy Evans
This were previously hidden because calls from C were not warned. Notes: Merged: https://github.com/ruby/ruby/pull/2432
2019-07-15Move helper file of logger to under the test/logger.Hiroshi SHIBATA
2019-07-15[ruby/logger] Add option to set the binary mode of the log deviceRafael Mendonça França
Without binmode strings with incompatible encoding can't be written in the file. This is very common in applications that log user provided parameters. We need to allow changing the binnary mode because right now it is impossible to use the built-in log rotation feature when you provide a File object to the LogDevice, and if you provide a filename you can't have binmode. https://github.com/ruby/logger/commit/9114b3ac7e
2019-07-15[ruby/logger] Set filename when initializing logger with a File objectJeremy Evans
This should allow reopen to work. Requested in ruby issue #14595. https://github.com/ruby/logger/commit/bd367aff12
2019-07-15[ruby/logger] Fix to use logger and test-unit in this repo withsonots
`ruby test/logger/test_xxx.rb` https://github.com/ruby/logger/commit/d3c2402340
2019-07-15[ruby/logger] Add support for changing severity using bang methods.Samuel Williams
https://github.com/ruby/logger/commit/ae4c6dfcbb
2019-07-02Fix timezone issue for logger period's testsYusuke Endoh
This is a retry of 181b966e7553ac53d034266a7cdc18664d080814. "Revert "Add a missing tests for Logger::Period module"" is also reverted.
2019-07-02Revert "Add a missing tests for Logger::Period module"Koichi Sasada
This reverts commit 181b966e7553ac53d034266a7cdc18664d080814.
2019-07-02Add a missing tests for Logger::Period moduleAnton Davydov
Closes: https://github.com/ruby/ruby/pull/2266
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