Module: Padrino::Logger::Extensions
- Included in:
- Padrino::Logger
Constant Summary collapse
- SOURCE_LOCATION_REGEXP =
/^(.*?):(\d+?)(?::in `.+?')?$/.freeze
Instance Method Summary
-
#bench(action, began_at, message, level = :debug, color = :yellow) ⇒ Object
Append a to development logger a given action with time. -
#colorize(string, *colors) ⇒ Object
Colorizes a string for colored console output. -
#colorize! ⇒ Object
Turns a logger with LoggingExtensions into a logger with colorized output. -
#enable_source_location? ⇒ Boolean
Returns true if :source_location is set to true. -
#exception(boom, verbosity = :long, level = :error) ⇒ Object
Logs an exception. -
#format(message, level) ⇒ Object
Formats the log message. -
#name ⇒ Object
Generate the logging methods for Padrino.logger for each log level. -
#push(message = nil, level = nil) ⇒ Object
Appends a message to the log. -
#resolve_source_location(message) ⇒ Object
Resolves a filename and line-number from caller. -
#stylized_level(level) ⇒ Object
The debug level, with some style added.
Instance Method Details
#bench(action, began_at, message, level = :debug, color = :yellow) ⇒ Object
Append a to development logger a given action with time.
#colorize(string, *colors) ⇒ Object
Colorizes a string for colored console output. This is a noop and can be reimplemented to colorize the string as needed.
#colorize! ⇒ Object
Turns a logger with LoggingExtensions into a logger with colorized output.
#enable_source_location? ⇒ Boolean
Returns true if :source_location is set to true.
#exception(boom, verbosity = :long, level = :error) ⇒ Object
Logs an exception.
#format(message, level) ⇒ Object
Formats the log message. This method is a noop and should be implemented by other logger components such as Padrino::Logger.
#name ⇒ Object
Generate the logging methods for Padrino.logger for each log level.
#push(message = nil, level = nil) ⇒ Object
Appends a message to the log. The methods yield to an optional block and the output of this block will be appended to the message.
#resolve_source_location(message) ⇒ Object
Resolves a filename and line-number from caller.
#stylized_level(level) ⇒ Object
The debug level, with some style added. May be reimplemented.
© 2010–2020 Padrino
Licensed under the MIT License.
https://www.rubydoc.info/github/padrino/padrino-framework/Padrino/Logger/Extensions