Class: Tracing::TemplateLogAppender
- Inherits:
-
FileAppender
- Object
- BaseAppender
- FileAppender
- Tracing::TemplateLogAppender
- Defined in:
- lib/appenders/types/template_log_appender.rb
Instance Attribute Summary
Attributes inherited from BaseAppender
Attributes included from FilterUse
Attributes included from Filter::ExecUse
Attributes included from Filter::Registration
Instance Method Summary collapse
-
#allow_append(lines, context) ⇒ Object
perform append.
-
#initialize(init_options) ⇒ TemplateLogAppender
constructor
A new instance of TemplateLogAppender.
-
#not_allow_append(lines, context) ⇒ Object
silently ignore.
-
#template_path(context) ⇒ Object
get template path.
Methods inherited from FileAppender
#create_initial_file, #file_path, #insert_into_file, #is_old_file?, #write_file
Methods included from DefaultPath
Methods inherited from BaseAppender
create_template, #handle, register_templates, #time_limit
Methods included from Filter::Registration
#_register_filters, #create_filters, #register_filters, #unregister_filters
Constructor Details
#initialize(init_options) ⇒ TemplateLogAppender
Returns a new instance of TemplateLogAppender.
4 5 6 7 |
# File 'lib/appenders/types/template_log_appender.rb', line 4 def initialize() @tracer = Tracing::OutputTemplate::StringTrace.new super() end |
Instance Method Details
#allow_append(lines, context) ⇒ Object
perform append
16 17 18 19 20 21 22 |
# File 'lib/appenders/types/template_log_appender.rb', line 16 def allow_append(lines, context) path = template_path(context) if path log_file = + '.log' write_file(log_file) end end |
#not_allow_append(lines, context) ⇒ Object
silently ignore
25 26 |
# File 'lib/appenders/types/template_log_appender.rb', line 25 def not_allow_append(lines, context) end |
#template_path(context) ⇒ Object
get template path
10 11 12 13 |
# File 'lib/appenders/types/template_log_appender.rb', line 10 def template_path(context) obj = context[:self] template_path = obj.instance_variable_get :@template_path end |