| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Since Rails 6.0 will support Ruby 2.4.1 or higher
`# frozen_string_literal: true` magic comment is enough to make string object frozen.
This magic comment is enabled by `Style/FrozenStringLiteralComment` cop.
* Exclude these files not to auto correct false positive `Regexp#freeze`
- 'actionpack/lib/action_dispatch/journey/router/utils.rb'
- 'activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb'
It has been fixed by https://github.com/rubocop-hq/rubocop/pull/6333
Once the newer version of RuboCop released and available at Code Climate these exclude entries should be removed.
* Replace `String#freeze` with `String#-@` manually if explicit frozen string objects are required
- 'actionpack/test/controller/test_case_test.rb'
- 'activemodel/test/cases/type/string_test.rb'
- 'activesupport/lib/active_support/core_ext/string/strip.rb'
- 'activesupport/test/core_ext/string_ext_test.rb'
- 'railties/test/generators/actions_test.rb'
|
|\
| |
| |
| | |
TaggedLogging to return a new logger instance
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
tags_text method creates 3 Ruby objects per each logger call when no custom tags are given
(which is the default setting, and so presumably the majority use case).
This patch reduces two temporary object creations in this case.
require 'allocation_tracer'
ObjectSpace::AllocationTracer.setup(%i{type})
tags = ['a']
pp before: ObjectSpace::AllocationTracer.trace {
tags.collect { |tag| "[#{tag}] " }.join
}
pp after: ObjectSpace::AllocationTracer.trace {
"[#{tags[0]}] "
}
{:before=>{[:T_ARRAY]=>[1, 0, 0, 0, 0, 0], [:T_STRING]=>[2, 0, 0, 0, 0, 0]}}
{:after=>{[:T_STRING]=>[1, 0, 0, 0, 0, 0]}}
|
| |
| |
| |
| | |
This basically reverts 8da30ad6be34339124ba4cb4e36aea260dda12bc
|
| | |
|
| | |
|
|/ |
|
|
|
|
|
|
| |
fatal multiple times. Expose tags_text from TaggedLogging to be used for log formatting
Fixes #26134
|
|
|
|
|
| |
The current code base is not uniform. After some discussion,
we have chosen to go with double quotes by default.
|
| |
|
|\
| |
| | |
Fix TaggedLogging to allow loggers to be instantiated multiple times without having to share the stack of tags
|
| |
| |
| |
| | |
having to share the stack of tags. This is accomplished by using a unique key for the thread-local tag list. Fixes #9064.
|
| |
| |
| | |
we’re using .delegate and should require it.
|
| |
| |
| |
| |
| |
| | |
This reverts commit b7d9d6e2cd5082d269dafbc0316e2107febe1451.
Per discussion with @jeremy and @rubys on Campfire.
|
|/ |
|
|
|
|
|
|
|
|
|
|
| |
Sometimes, on Mac OS X, programmers accidentally press Option+Space
rather than just Space and don’t see the difference. The problem is
that Option+Space writes a non-breaking space (0XA0) rather than a
normal space (0x20).
This commit removes all the non-breaking spaces inadvertently
introduced in the comments of the code.
|
|
|
|
| |
SimpleFormatter. Otherwise we try extending nil with the tagging API.
|
| |
|
| |
|
|
|
|
|
|
| |
This reverts commit b0ab8dc0b2b0f580ffe5ac9ff57fd13152e18577
because it was removing the contents of the message when we
did not have any tag. A test case is also committed.
|
|
|
|
| |
Use lstrip method
|
|
|
|
|
| |
This reverts commit c08f30ff5fcda7e07cd9275a073acb2091e4b3f7, reversing
changes made to e243a8a32eb4c8777f07ca4b974bd7e38d9477d3.
|
|
|
|
| |
When the default separator is set logger will create incorrect output
|
| |
|
|
|
|
|
|
|
|
|
|
| |
this improves encapsulation, simplifying occurrences like the following:
Rails.logger.tagged("DEBUG") { Rails.logger.debug(msg) }
... by removing the need to rely on (i.e. repeat) outer variables:
Rails.logger.tagged("DEBUG") { |logger| logger.debug(msg) }
|
| |
|
|\ |
|
| | |
|
| | |
|
| |
| |
| |
| | |
(from the example)
|
|/ |
|
| |
|
|
|
|
| |
previous solution can cause race conditions under GIL-free ruby implementations
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
logs for a certain block, change the log level for that block.
* ActiveSupport::BufferedLogger#open_log is deprecated. This method should
not have been public in the first place.
* ActiveSupport::BufferedLogger's behavior of automatically creating the
directory for your log file is deprecated. Please make sure to create the
directory for your log file before instantiating.
* ActiveSupport::BufferedLogger#auto_flushing is deprecated. Either set the
sync level on the underlying file handle like this:
f = File.open('foo.log', 'w')
f.sync = true
ActiveSupport::BufferedLogger.new f
Or tune your filesystem. The FS cache is now what controls flushing.
* ActiveSupport::BufferedLogger#flush is deprecated. Set sync on your
filehandle, or tune your filesystem.
|
| |
|
|
|
| |
In log it should not show the empty array.
|
| |
|
|
|
|
| |
instead (SyslogLogger didnt define them as I expected)
|
|
production concerns
|