Class: MojoLogger::Appender
- Inherits:
-
Object
- Object
- MojoLogger::Appender
- Defined in:
- lib/mojo_logger/appender.rb
Constant Summary collapse
- ACCEPTABLE_LOG_LEVELS =
[ "DEBUG", "INFO", "WARN", "ERROR", "FATAL" ]
Instance Attribute Summary collapse
-
#file ⇒ Object
Returns the value of attribute file.
-
#level ⇒ Object
Returns the value of attribute level.
-
#max_backup_index ⇒ Object
Returns the value of attribute max_backup_index.
-
#max_file_size ⇒ Object
Returns the value of attribute max_file_size.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#pattern ⇒ Object
Returns the value of attribute pattern.
Instance Method Summary collapse
- #generate_properties_string ⇒ Object
-
#initialize(name, opts = {}) ⇒ Appender
constructor
A new instance of Appender.
Constructor Details
#initialize(name, opts = {}) ⇒ Appender
Returns a new instance of Appender.
15 16 17 18 |
# File 'lib/mojo_logger/appender.rb', line 15 def initialize(name, opts={}) @name = name set_defaults(opts) end |
Instance Attribute Details
#file ⇒ Object
Returns the value of attribute file.
12 13 14 |
# File 'lib/mojo_logger/appender.rb', line 12 def file @file end |
#level ⇒ Object
Returns the value of attribute level.
12 13 14 |
# File 'lib/mojo_logger/appender.rb', line 12 def level @level end |
#max_backup_index ⇒ Object
Returns the value of attribute max_backup_index.
13 14 15 |
# File 'lib/mojo_logger/appender.rb', line 13 def max_backup_index @max_backup_index end |
#max_file_size ⇒ Object
Returns the value of attribute max_file_size.
13 14 15 |
# File 'lib/mojo_logger/appender.rb', line 13 def max_file_size @max_file_size end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
12 13 14 |
# File 'lib/mojo_logger/appender.rb', line 12 def name @name end |
#pattern ⇒ Object
Returns the value of attribute pattern.
13 14 15 |
# File 'lib/mojo_logger/appender.rb', line 13 def pattern @pattern end |
Instance Method Details
#generate_properties_string ⇒ Object
31 32 33 34 35 |
# File 'lib/mojo_logger/appender.rb', line 31 def generate_properties_string properties = generate_generic_properties properties << generate_file_properties if @file properties end |