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
11 12 13 |
# File 'lib/logging_library/custom_formatter.rb', line 11 def logger_name @logger_name end |
#message ⇒ Object
Returns the value of attribute message
11 12 13 |
# File 'lib/logging_library/custom_formatter.rb', line 11 def @message end |
#severity ⇒ Object
Returns the value of attribute severity
11 12 13 |
# File 'lib/logging_library/custom_formatter.rb', line 11 def severity @severity end |
#time ⇒ Object
Returns the value of attribute time
11 12 13 |
# File 'lib/logging_library/custom_formatter.rb', line 11 def time @time end |
Instance Method Details
#to_formatted_string ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/logging_library/custom_formatter.rb', line 12 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 |