summaryrefslogtreecommitdiff
path: root/test/logger/test_logger.rb
AgeCommit message (Collapse)Author
2021-12-18[ruby/logger] Test casesBaron Bloomer
https://github.com/ruby/logger/commit/40adb645e2
2021-09-15[ruby/logger] Ignored loading CoreAssertions in test runnerHiroshi SHIBATA
https://github.com/ruby/logger/commit/2fd5401ad6
2020-06-11[ruby/logger] Let Logger#reopen not raise on nil log devicesLourens Naudé
https://github.com/ruby/logger/commit/da7bf844e5
2020-06-11[ruby/logger] Let File::NULL ("/dev/null", "NUL" etc.) be considered a nil ↵Lourens Naudé
log device https://github.com/ruby/logger/commit/b42a1b99aa
2019-12-10[ruby/logger] Honor Logger#level overridesGeorge Claghorn
https://github.com/ruby/logger/commit/7365c995bf
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] Fix to use logger and test-unit in this repo withsonots
`ruby test/logger/test_xxx.rb` https://github.com/ruby/logger/commit/d3c2402340
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-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-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-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-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
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
2005-09-13 * lib/logger.rb (Logger): added formatter accessor to logger fornahi
dictating the way in which the logger should format the messages it displays. Thanks to Nicholas Seckar (cf. [ruby-talk:153391]) and Daniel Berger. * lib/logger.rb (Logger): added VERSION constant. * lib/logger.rb: removed document for LogDevice. It is an implementation detail and is not a public interface. * test/logger/test_logger.rb: added tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9151 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-08-24* test/logger/test_logger.rb (test_shifting_size): should close logusa
device before unlink, since some platform cannot unlink opened file. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9027 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-08-20 * lib/logger.rb (write, shift_log?, shift_log): file shifting racenahi
condition bug fixed. [ruby-dev:26764] * test/logger/test_logger.rb: tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9011 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-03-04* array.c: replace rb_protect_inspect() and rb_inspecting_p() bymatz
rb_exec_recursive() in eval.c. * eval.c (rb_exec_recursive): new function. * array.c (rb_ary_join): use rb_exec_recursive(). * array.c (rb_ary_inspect, rb_ary_hash): ditto. * file.c (rb_file_join): ditto. * hash.c (rb_hash_inspect, rb_hash_to_s, rb_hash_hash): ditto. * io.c (rb_io_puts): ditto. * object.c (rb_obj_inspect): ditto * struct.c (rb_struct_inspect): ditto. * lib/set.rb (SortedSet::setup): a hack to shut up warning. [ruby-talk:132866] * lib/time.rb (Time::strptime): add new function. inspired by [ruby-talk:132815]. * lib/parsedate.rb (ParseDate::strptime): ditto. * regparse.c: move st_*_strend() functions from st.c. fixed some potential memory leaks. * exception error messages updated. [ruby-core:04497] * ext/socket/socket.c (Init_socket): add bunch of Socket constants. Patch from Sam Roberts <sroberts@uniserve.com>. [ruby-core:04409] * array.c (rb_ary_s_create): no need for negative argc check. [ruby-core:04463] * array.c (rb_ary_unshift_m): ditto. * lib/xmlrpc/parser.rb (XMLRPC::FaultException): make it subclass of StandardError class, not Exception class. [ruby-core:04429] * parse.y (fcall_gen): lvar(arg) will be evaluated as lvar.call(arg) when lvar is a defined local variable. [new] * object.c (rb_class_initialize): call inherited method before calling initializing block. * eval.c (rb_thread_start_1): initialize newly pushed frame. * lib/open3.rb (Open3::popen3): $? should not be EXIT_FAILURE. fixed: [ruby-core:04444] * eval.c (is_defined): NODE_IASGN is an assignment. * ext/readline/readline.c (Readline.readline): use rl_outstream and rl_instream. [ruby-dev:25699] * ext/etc/etc.c (Init_etc): sGroup needs HAVE_ST_GR_PASSWD check [ruby-dev:25675] * misc/ruby-mode.el: [ruby-core:04415] * lib/rdoc/generators/html_generator.rb: [ruby-core:04412] * lib/rdoc/generators/ri_generator.rb: ditto. * struct.c (make_struct): fixed: [ruby-core:04402] * ext/curses/curses.c (window_color_set): [ruby-core:04393] * ext/socket/socket.c (Init_socket): SO_REUSEPORT added. [ruby-talk:130092] * object.c: [ruby-doc:818] * parse.y (open_args): fix too verbose warnings for the space before argument parentheses. [ruby-dev:25492] * parse.y (parser_yylex): ditto. * parse.y (parser_yylex): the first expression in the parentheses should not be a command. [ruby-dev:25492] * lib/irb/context.rb (IRB::Context::initialize): [ruby-core:04330] * object.c (Init_Object): remove Object#type. [ruby-core:04335] * st.c (st_foreach): report success/failure by return value. [ruby-Bugs-1396] * parse.y: forgot to initialize parser struct. [ruby-dev:25492] * parse.y (parser_yylex): no tLABEL on EXPR_BEG. [ruby-talk:127711] * document updates - [ruby-core:04296], [ruby-core:04301], [ruby-core:04302], [ruby-core:04307] * dir.c (rb_push_glob): should work for NUL delimited patterns. * dir.c (rb_glob2): should aware of offset in the pattern. * string.c (rb_str_new4): should propagate taintedness. * env.h: rename member names in struct FRAME; last_func -> callee, orig_func -> this_func, last_class -> this_class. * struct.c (rb_struct_set): use original method name, not callee name, to retrieve member slot. [ruby-core:04268] * time.c (time_strftime): protect from format modification from GC finalizers. * object.c (Init_Object): remove rb_obj_id_obsolete() * eval.c (rb_mod_define_method): incomplete subclass check. [ruby-dev:25464] * gc.c (rb_data_object_alloc): klass may be NULL. [ruby-list:40498] * bignum.c (rb_big_rand): should return positive random number. [ruby-dev:25401] * bignum.c (rb_big_rand): do not use rb_big_modulo to generate random bignums. [ruby-dev:25396] * variable.c (rb_autoload): [ruby-dev:25373] * eval.c (svalue_to_avalue): [ruby-dev:25366] * string.c (rb_str_justify): [ruby-dev:25367] * io.c (rb_f_select): [ruby-dev:25312] * ext/socket/socket.c (sock_s_getservbyport): [ruby-talk:124072] * struct.c (make_struct): [ruby-dev:25249] * dir.c (dir_open_dir): new function. [ruby-dev:25242] * io.c (rb_f_open): add type check for return value from to_open. * lib/pstore.rb (PStore#transaction): Use the empty content when a file is not found. [ruby-dev:24561] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8068 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-11-13Sun Nov 14 08:46:33 2004 NAKAMURA, Hiroshi <nakahiro@sarion.co.jp>nahi
* test/logger/test_logger.rb: Logger just expects Logger#datetime_format to be used for Time#strftime independently of locale. [ruby-dev:24828] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7260 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-01-06 * lib/logger.rb(Logger#msg2str): no special treatment for the objectnahi
which responds to :to_str. * lib/logger.rb(LogDevice#initialize): remove type checking if the given object is a String. Kernel.open handles it correctly. * test/logger/test_logger.rb: follow above change (ArgumentError -> TypeError.) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5389 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-10-01* test/logger/test_logger.rb: unlinking file before close causes problem undernahi
win32 box. * lib/xsd/datatypes.rb(XSDFloat, XSDDouble): add +/- sign explicitly when stringified and embedded into XML instance. Ruby's sprintf may format -0.0 as "0.0" (no minus sign) depending on underlying C sprintf implementation. * test/xsd/test_xsd.rb, test/soap/test_basetype.rb: follow above change. * test/soap/calc/*: give httpd config param "CGIInterpreter". "/usr/bin/env ruby" thing does not work under non-Unix boxes. * ChangeLog: corrected wrong DoW of my log entries... git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4643 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-09-29* lib/logger.rb: check if the given logdevice object respond_to :write andnahi
:close, not is_a? IO. duck duck. * test/logger/test_logger.rb: self IO.pipe reading/writing may be locked by the flood. use tempfile. * lib/wsdl/xmlSchema/data.rb: wrong constant reference. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4622 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-09-23* lib/logger.rb: add Logger#<<(msg) for writing msg without any formatting.nahi
* test/logger/test_logger.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4586 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-09-20* reduce expecting size of backtrace.nahi
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4581 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-09-20* lib/logger.rb: typo fixed.nahi
* test/logger/test_logger.rb: new file. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4580 b2dd03c8-39d4-4d8f-98ff-823fe69b080e