File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change 4
4
require "active_support/logger"
5
5
6
6
module ActiveJob
7
- module Logging # :nodoc:
7
+ module Logging
8
8
extend ActiveSupport ::Concern
9
9
10
10
included do
11
+ ##
12
+ # Accepts a logger conforming to the interface of Log4r or the default
13
+ # Ruby +Logger+ class. You can retrieve this logger by calling +logger+ on
14
+ # either an Active Job job class or an Active Job job instance.
11
15
cattr_accessor :logger , default : ActiveSupport ::TaggedLogging . new ( ActiveSupport ::Logger . new ( STDOUT ) )
16
+
17
+ ##
18
+ # Configures whether a job's arguments should be logged. This can be
19
+ # useful when a job's arguments may be sensitive and so should not be
20
+ # logged.
21
+ #
22
+ # The value defaults to +true+, but this can be configured with
23
+ # +config.active_job.log_arguments+. Additionally, individual jobs can
24
+ # also configure a value, which will apply to themselves and any
25
+ # subclasses.
12
26
class_attribute :log_arguments , instance_accessor : false , default : true
13
27
14
28
around_enqueue ( prepend : true ) { |_ , block | tag_logger ( &block ) }
15
29
end
16
30
17
- def perform_now
31
+ def perform_now # :nodoc:
18
32
tag_logger ( self . class . name , self . job_id ) { super }
19
33
end
20
34
You can’t perform that action at this time.
0 commit comments