Module: Tracee
- Defined in:
- lib/tracee/preprocessors/quiet_assets.rb,
lib/tracee.rb,
lib/tracee/stack.rb,
lib/tracee/logger.rb,
lib/tracee/stream.rb,
lib/tracee/version.rb,
lib/tracee/benchmarkable.rb,
lib/tracee/ext/exception.rb,
lib/tracee/ext/better_errors.rb,
lib/tracee/ext/active_support.rb,
lib/tracee/preprocessors/base.rb,
lib/tracee/stack/base_decorator.rb,
lib/tracee/preprocessors/formatter.rb
Overview
quiet_assets gem works only on thread-safe environment or on multithreaded one with only few assets. Known issue: github.com/evrone/quiet_assets/issues/40 I’d fix it so that it would always reset log_level to that of Rails.application.config.log_level But such an approach will not allow to change log_level within runtime.
Tracee deals with it in pretty straightforward manner. It just ignores whatever we do not care about.
Defined Under Namespace
Modules: Benchmarkable, Extensions, Preprocessors, Stack
Classes: Benchmark, IndifferentStream, Logger, Stream
Constant Summary
collapse
- CALLER_RE =
%r{^(?<path>.*?(?<file>[^/\\]+?))#{ # ( path ( file ) )
}:(?<line>\d+)(?::in #{ # :( line )[ :in
}`(?<is_block>block (?:\((?<block_level>\d+) levels\) )?in )?(?<method>.+?)'#{ # `( [ block in ] closure )' ]
})?$}
- IGNORE_RE =
%r{/irb(/|\.rb$)#{ # irb internals
}|lib/active_support/dependencies.rb$#{ # everywhere-proxy
}|^-e$#{ # ruby -e oneliner
}|^(script|bin)/#{ # other common entry points
}|/gems/bundler-\d|ruby-\d.\d.\d(@[^/]+)?/bin/#{ # bundle console
}|bin/rails$|lib/rails/commands(/|\.rb$)#{ # rails console
}|lib/spring/#{ # spring middleware
}|/rubygems/core_ext/kernel_require.rb#{ # `require' override
}}
- VERSION =
"1.0.12"
Class Method Summary
collapse
Class Method Details
.decorate_active_support_stack ⇒ Object
92
93
94
|
# File 'lib/tracee.rb', line 92
def decorate_active_support_stack
ActiveSupport::BacktraceCleaner.prepend Tracee::Extensions::ActiveSupport::BacktraceCleaner
end
|
.decorate_better_errors_stack(from_decorate_everywhere = false) ⇒ Object
82
83
84
85
86
87
88
89
90
|
# File 'lib/tracee.rb', line 82
def decorate_better_errors_stack(from_decorate_everywhere=false)
if defined? BetterErrors
BetterErrors::Middleware.class_eval do
include Tracee::Extensions::BetterErrors::Middleware
end
elsif !from_decorate_everywhere
warn "Tracee.decorate_better_errors_stack was ignored, because BetterErrors hadn't been defined."
end
end
|
.decorate_exceptions_stack ⇒ Object
70
71
72
73
74
75
76
77
78
79
80
|
# File 'lib/tracee.rb', line 70
def decorate_exceptions_stack
Exception.trace_decorator = Stack::BaseDecorator
[SystemStackError, NoMemoryError, NameError, defined?(IRB::Abort) && IRB::Abort].compact.each do |klass|
klass.trace_decorator = nil
end
NoMethodError.trace_decorator = Exception.trace_decorator
end
|
.decorate_stack_everywhere ⇒ Object
96
97
98
99
100
|
# File 'lib/tracee.rb', line 96
def decorate_stack_everywhere
decorate_exceptions_stack
decorate_better_errors_stack(true)
decorate_active_support_stack
end
|