Class: LoggingLibrary::CustomFormatter::LogMessage
- Inherits:
-
Struct
- Object
- Struct
- LoggingLibrary::CustomFormatter::LogMessage
- Defined in:
- lib/logging_library/custom_formatter.rb
Instance Attribute Summary collapse
-
#logger_name ⇒ Object
Returns the value of attribute logger_name.
-
#message ⇒ Object
Returns the value of attribute message.
-
#severity ⇒ Object
Returns the value of attribute severity.
-
#time ⇒ Object
Returns the value of attribute time.
Instance Method Summary collapse
Instance Attribute Details
#logger_name ⇒ Object
Returns the value of attribute logger_name
13 14 15 |
# File 'lib/logging_library/custom_formatter.rb', line 13 def logger_name @logger_name end |
#message ⇒ Object
Returns the value of attribute message
13 14 15 |
# File 'lib/logging_library/custom_formatter.rb', line 13 def @message end |
#severity ⇒ Object
Returns the value of attribute severity
13 14 15 |
# File 'lib/logging_library/custom_formatter.rb', line 13 def severity @severity end |
#time ⇒ Object
Returns the value of attribute time
13 14 15 |
# File 'lib/logging_library/custom_formatter.rb', line 13 def time @time end |
Instance Method Details
#to_formatted_string ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/logging_library/custom_formatter.rb', line 14 def to_formatted_string if show_time? format("%s %s %s %s\n", formatted_colored_severity, formatted_colored_time, formatted_colored_logger_name, ) else format("%-5s %s %s\n", formatted_colored_severity, formatted_colored_logger_name, ) end end |